You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<summary><h2style="display: inline-block">Table of Contents</h2></summary>
60
+
<details>
61
+
<summary>Table of Contents</summary>
62
62
<ol>
63
63
<li>
64
64
<a href="#about-the-project">About The Project</a>
@@ -87,7 +87,7 @@
87
87
<!-- ABOUT THE PROJECT -->
88
88
## About The Project
89
89
90
-
To be added soon.
90
+
Sometimes, swapping out classes is not enough so you can instead modify the stylesheets themselves. change-css is a library that can help you do just that. This can be a very easy path to theming a dynamic site, especially if the theme variables are generated through JS.
91
91
<!-- [![Product Name Screen Shot][product-screenshot]](https://example.com)
92
92
93
93
Here's a blank template to get started:
@@ -122,9 +122,9 @@ You need to have node and NPM installed
122
122
```sh
123
123
npm install --save change-css
124
124
```
125
-
2. Import into your file
125
+
2. Import necessary functions into your file
126
126
```js
127
-
constgetCSSRule=require('change-css'); // This is the only function that is available at the moment
@@ -133,15 +133,22 @@ You need to have node and NPM installed
133
133
## Usage
134
134
135
135
### Get a CSS Rule
136
-
Use the getCSSRule to search your document's stylesheets for a [CSS Rule](https://developer.mozilla.org/en-US/docs/Web/API/CSSRule).
136
+
Use getCSSRule() to search your document's stylesheets for a [CSS Rule](https://developer.mozilla.org/en-US/docs/Web/API/CSSRule).
137
137
```js
138
-
constgetCSSRule=require('change-css');
138
+
import { getCSSRule} from'change-css';
139
139
constCSSRule=getCSSRule('.text-base');
140
140
// Returns a CSSRule if such a rule exists
141
141
// in any of the stylesheets in your document
142
142
// else returns false.
143
143
```
144
144
145
+
### Modify a CSS Rule
146
+
The modifyCSSRule() function makes it easier to modify a [CSS Rule](https://developer.mozilla.org/en-US/docs/Web/API/CSSRule) with a single function call.
147
+
```js
148
+
import { modifyCSSRule } from'change-css';
149
+
modifyCSSRule('body', { fontFamily:'Inter' });
150
+
```
151
+
145
152
<!-- _For more examples, please refer to the [Documentation](https://example.com)_ -->
0 commit comments