@griffel/react 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -133,6 +133,40 @@ function App() {
|
|
|
133
133
|
}
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
+
## `createDOMRenderer()`, `RendererProvider`
|
|
137
|
+
|
|
138
|
+
`createDOMRenderer` is paired with `RendererProvider` component and is useful for child window rendering and SSR scenarios. This is the default renderer for web, and will make sure that styles are injected to a document.
|
|
139
|
+
|
|
140
|
+
```jsx
|
|
141
|
+
import { createDOMRenderer, RendererProvider } from '@griffel/react';
|
|
142
|
+
|
|
143
|
+
function App(props) {
|
|
144
|
+
const { targetDocument } = props;
|
|
145
|
+
const renderer = React.useMemo(() => createDOMRenderer(targetDocument), [targetDocument]);
|
|
146
|
+
|
|
147
|
+
return (
|
|
148
|
+
<RendererProvider renderer={renderer} targetDocument={targetDocument}>
|
|
149
|
+
{/* Children components */}
|
|
150
|
+
{/* ... */}
|
|
151
|
+
</RendererProvider>
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### styleElementAttributes
|
|
157
|
+
|
|
158
|
+
A map of attributes that's passed to the generated style elements. For example, is useful to set ["nonce" attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce).
|
|
159
|
+
|
|
160
|
+
```js
|
|
161
|
+
import { createDOMRenderer } from '@griffel/react';
|
|
162
|
+
|
|
163
|
+
const renderer = createDOMRenderer(targetDocument, {
|
|
164
|
+
styleElementAttributes: {
|
|
165
|
+
nonce: 'random',
|
|
166
|
+
},
|
|
167
|
+
});
|
|
168
|
+
```
|
|
169
|
+
|
|
136
170
|
## Features support
|
|
137
171
|
|
|
138
172
|
### 📃 pseudo & class selectors, at-rules, global styles
|
|
@@ -202,3 +236,18 @@ const useClasses = makeStyles({
|
|
|
202
236
|
},
|
|
203
237
|
});
|
|
204
238
|
```
|
|
239
|
+
|
|
240
|
+
### CSS Fallback Properties
|
|
241
|
+
|
|
242
|
+
Any CSS property accepts an array of values which are all added to the styles.
|
|
243
|
+
Every browser will use the latest valid value (which might be a different one in different browsers, based on supported CSS in that browser):
|
|
244
|
+
|
|
245
|
+
```js
|
|
246
|
+
import { makeStyles } from '@griffel/react';
|
|
247
|
+
|
|
248
|
+
const useClasses = makeStyles({
|
|
249
|
+
root: {
|
|
250
|
+
overflowY: ['scroll', 'overlay'],
|
|
251
|
+
},
|
|
252
|
+
});
|
|
253
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griffel/react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "React implementation of Atomic CSS-in-JS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"sideEffects": false,
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@griffel/core": "^1.
|
|
12
|
+
"@griffel/core": "^1.2.0",
|
|
13
13
|
"tslib": "^2.1.0"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|