From 6eef03c589119523c1b65c1407709a34ba4c6ec7 Mon Sep 17 00:00:00 2001
From: Travis CI element on the page will have a font-size of 20px
+```
+
+Examples
+
+```js
+getStyle(document.querySelector('p'), 'font-size'); // '16px'
+```
+
+Examples
+
+```js
+setStyle(document.querySelector('p'), 'font-size', '20px'); // The first el to use a default value of window.
getScrollPosition(); // {x: 0, y: 200}
+Returns the value of a CSS rule for the specified element.
+Use Window.getComputedStyle() to get the value of the CSS rule for the specified element.
const getStyle = (el, ruleName) => getComputedStyle(el)[ruleName];
+
+getStyle(document.querySelector('p'), 'font-size'); // '16px'
+
Returns an object containing the parameters of the current URL.
Use match() with an appropriate regular expression to get all key-value pairs, Array.reduce() to map and combine them into a single object.
@@ -907,6 +916,13 @@ Scroll by a fraction of the distance from the top. Use window.requestAnima
scrollToTop();
+Sets the value of a CSS rule for the specified element.
+Use element.style to set the value of the CSS rule for the specified element to value.
const setStyle = (el, ruleName, value) => (el.style[ruleName] = value);
+
+setStyle(document.querySelector('p'), 'font-size', '20px'); // The first <p> element on the page will have a font-size of 20px
+
Shows all the elements specified.
Use the spread operator (...) and Array.forEach() to clear the display property for each element specified.
element on the page will have a font-size of 20px +setStyle(document.querySelector('p'), 'font-size', '20px'); // The first
element on the page will have a font-size of 20px ```