File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ Benefits compared to using the core JSS package directly:
2323- [ Accessing the theme inside the styled component] ( #accessing-the-theme-inside-the-styled-component )
2424- [ Accessing the theme without styles] ( #accessing-the-theme-without-styles )
2525- [ Using custom Theming Context] ( #using-custom-theming-context )
26+ - [ Class name generator options] ( #class-name-generator-options )
2627- [ Server-side rendering] ( #server-side-rendering )
2728- [ React tree traversing] ( #react-tree-traversing )
2829- [ Custom setup] ( #custom-setup )
@@ -320,6 +321,29 @@ const App = () => (
320321)
321322```
322323
324+ ## Class name generator options
325+
326+ Make sure using the same setup on the server and on the client. Id generator is used for class names and for keyframes.
327+
328+ 1 . You can change the class name generation algorithm by passing your custom [ generator function] ( ./jss-api.md#generate-your-class-names ) prop.
329+
330+ ``` javascript
331+ const generateId = (rule , sheet ) => ' some-id'
332+ < JssProvider generateId= {generateId}>
333+ < MyApp / >
334+ < / JssProvider>
335+ ```
336+
337+ 1 . You can add an additional prefix to each class, [ see here] ( #multi-tree-setup ) .
338+
339+ 1 . You can minify class names by passing id options, so that prefixes will not be used even if defined, [ see also] ( ./jss-api.md#minify-selectors ) .
340+
341+ ``` javascript
342+ < JssProvider id= {{minify: true }}>
343+ < MyApp / >
344+ < / JssProvider>
345+ ```
346+
323347## Server-side rendering
324348
325349After the application is mounted, you should remove the style tag used by critical CSS rendered server-side.
You can’t perform that action at this time.
0 commit comments