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
* added fallbacks test to fn rules
* only call onChangeValue if plugins: true
* enable removing props from fn rules
* shorter syntax with coercion
* wip full syntax support
* restore browsers.json
* changelog
* move hook call to the core
* isProcessed flag explanation
* added tests to fn rules
* remove media rule as a function test case
* added a test for #796, as part of #682
* tests for compose plugin
* observables
- move documentation to the package
- update docs, since plugins don't apply by default
- introduce option process: true to the plugin to enable plugins if user wants that
* move fn values docs
* wording
* scoped keyframes
* Added tests for using jss-plugin-syntax-expand with function rules and values
* Skip fn values with jss-expand for now
* use "keyframes-{name}" as a key in KeyFramesRule
Changed the key to a form where it can be used directly as-is for id generation, so we don't have to fake the rule when using generateClassName
* keyframes name parser with validation
* wip keyframes inside of global
* move container rules update to the core
* optimize onProcessStyle
onProcessStyle is invoked on each .update, but in this case we only need to do this once, because fn values can't be added
* put variables in the right scope
* changelog
* update tests with key keyframes name
* Update changelog.md
* Update docs/json-api.md
* Update changelog.md
* process: true always
* support multiple whitespaces after keyframes identifier
* move keyframe name generation to outside
* call external plugins first
we need to separate internal and external queues, queue 0 is external, 1 is internal and 1 is executed always after 0
* move keyframes rule to plugins
* move StyleRule to a plugin
Additionally stop rendering StyleRule when user passes a bad/unknown at-rule
* move viewport rule to plugins
* move simple rule to plugins
* move FontFace rule
* rename plugins to {rule}Rule schema
* beter types for queue
* Add support for animation property
* optimize perf, handle arrays
* fix tests, add more tests
* Fix
* Support arrays
* remove array support
* use global instead of window
* always run stylerule plugin first, to avoid regexes of the at rules
* ensure to always use style rule as a first rule in plugins
flow started to complain with "Unused suppression comment." so I removed them
* fix cache plugin
* test raw rule registration order
* rewrite internal plugins queue
* better logic in plugins.use()
* better types
* better types
* fix types
* keyframe inside of global
TODO
- Rethink BaseStyleRule
- Evtl move generateClassName to the rule models
- Evtl rename generateClassName to generateId
* default export in plugins
* move id generator to models
* update snapshots
* fix circular deps
* use CSSKeyframeRule
* generateClassName -> generateId
* added exampls with keyframes to global plugin
* docs, small syntactic changes
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
@@ -32,7 +32,7 @@ export default jss
32
32
33
33
Options:
34
34
35
-
-`createGenerateClassName` - a function which returns a function which generates unique class names.
35
+
-`createGenerateId` - a function which returns a function which generates unique class names.
36
36
-`plugins` - an array of functions, will be passed to `jss.use`.
37
37
-`virtual` - if true, JSS will use VirtualRenderer.
38
38
-`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.
@@ -74,7 +74,7 @@ Options:
74
74
-`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.
75
75
-`element` - style element, will create one by default.
76
76
-`index` - 0 by default - determines DOM rendering order, higher number = higher specificity (inserted after).
77
-
-`generateClassName` - a function that generates a unique class name.
77
+
-`generateId` - a function that generates a unique class name.
78
78
-`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.
363
+
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.
364
364
365
365
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