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
Copy file name to clipboardExpand all lines: changelog.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,16 @@
1
1
## Next / 2018-09-16
2
2
3
3
- Fix multiple cases where linking CSS rules didn't work (#815, #710, #664)
4
+
- Added support for Typed CSSOM values (#882)
5
+
- Added scoped keyframes support (#346)
4
6
- Function values and function rules support now fallbacks, media queries, nesting, global styles (#682)
5
-
- Added support for Typed CSSOM values
6
7
7
8
### Breaking changes
8
9
9
10
- Observables, function values and rules are now standalone packages, not part of the core. They are still part of the default preset though.
10
11
- Function values, rules and observables apply plugins by default now, which means they can support all plugin defined syntaxes, but they are also slower by default. To speed them up use `sheet.update(data, {process: false})` for fn values/rules and `jss.use(pluginObservable({process: false}))` when setting up observables plugin. (#682)
12
+
- Rule @keyframes has now scoped name by default, which means that you can access it using `$ref` from the same sheet and generate global one as before using `@global` rule ((#346).
13
+
- Options `createGenerateClassName` and `generateClassName` are renamed to `createGenerateId` and `generateId` since th same function is now used to scope @keyframes rules. This affects both JSS and React-JSS.
Copy file name to clipboardExpand all lines: docs/js-api.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ export default jss
34
34
35
35
Options:
36
36
37
-
-`createGenerateClassName` - a function which returns a function which generates unique class names.
37
+
-`createGenerateId` - a function which returns a function which generates unique class names.
38
38
-`plugins` - an array of functions, will be passed to `jss.use`.
39
39
-`virtual` - if true, JSS will use VirtualRenderer.
40
40
-`insertionPoint` - string value of a DOM comment node which marks the start of sheets or a rendered DOM node. Sheets rendered by this Jss instance are inserted after this point sequentially.
@@ -76,7 +76,7 @@ Options:
76
76
-`link` - link jss `Rule` instances with DOM `CSSRule` instances so that styles, can be modified dynamically, false by default because it has some performance cost.
77
77
-`element` - style element, will create one by default.
78
78
-`index` - 0 by default - determines DOM rendering order, higher number = higher specificity (inserted after).
79
-
-`generateClassName` - a function that generates a unique class name.
79
+
-`generateId` - a function that generates a unique class name.
80
80
-`classNamePrefix` - a string, which will be added at the beginning of the class name.
Option `createGenerateClassName` allows you to specify a function which returns a class name generator function `generateClassName(rule, sheet)`. This pattern is used to allow JSS reset the counter upon factory invocation, when needed. For example, it is used in [React-JSS](https://github.com/cssinjs/react-jss) to reset the counter on each request for server-side rendering.
391
+
Option `createGenerateId` allows you to specify a function which returns a class name generator function `generateId(rule, sheet)`. This pattern is used to allow JSS reset the counter upon factory invocation, when needed. For example, it is used in [React-JSS](https://github.com/cssinjs/react-jss) to reset the counter on each request for server-side rendering.
392
392
393
393
By default class names generator uses a simple counter to ensure uniqueness of the class names. It consists of `classNamePrefix` Style Sheet option + rule name + counter. **Note**: in production (`NODE_ENV=production`) it uses just the `c` + rules counter.
Copy file name to clipboardExpand all lines: docs/json-api.md
+11-14Lines changed: 11 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,41 +69,38 @@ Compiles to:
69
69
70
70
## Keyframes Animation
71
71
72
-
Note: keyframe id is still global and may conflict.
72
+
Keyframes name will use the same id generator function as the class names. Animation name will be scoped by default. In order to access it within the same style sheet, you can use `$ref` syntax as a value of `animationName` or `animation` property.
73
73
74
-
```javascript
75
-
conststyles= {
76
-
'@keyframes my-animation': {
77
-
from: {opacity:0},
78
-
to: {opacity:1}
79
-
}
80
-
}
81
-
```
74
+
Additionally generated name can be accessed through `sheet.keyframes.{name}` map.
82
75
83
-
### ES6 with generated keyframe id
76
+
In order to generate a global animation name, you can use `@global` rule.
0 commit comments