@webref/css 6.23.0 → 7.0.0-alpha
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/CHANGELOG.md +17 -0
- package/README.md +37 -22
- package/css.json +17754 -0
- package/index.js +2 -9
- package/package.json +1 -1
- package/CSS.json +0 -567
- package/SVG.json +0 -387
- package/compat.json +0 -784
- package/compositing.json +0 -178
- package/css-align.json +0 -559
- package/css-anchor-position.json +0 -1042
- package/css-animations-2.json +0 -377
- package/css-animations.json +0 -337
- package/css-backgrounds-4.json +0 -402
- package/css-backgrounds.json +0 -732
- package/css-borders.json +0 -1642
- package/css-box.json +0 -484
- package/css-break.json +0 -444
- package/css-cascade-6.json +0 -31
- package/css-cascade.json +0 -91
- package/css-color-5.json +0 -527
- package/css-color-6.json +0 -60
- package/css-color-adjust.json +0 -151
- package/css-color-hdr.json +0 -183
- package/css-color.json +0 -1759
- package/css-conditional-4.json +0 -23
- package/css-conditional-5.json +0 -505
- package/css-conditional.json +0 -50
- package/css-contain.json +0 -123
- package/css-content.json +0 -466
- package/css-counter-styles.json +0 -613
- package/css-display.json +0 -444
- package/css-easing.json +0 -149
- package/css-env.json +0 -109
- package/css-exclusions.json +0 -108
- package/css-extensions.json +0 -36
- package/css-flexbox.json +0 -259
- package/css-fonts-5.json +0 -385
- package/css-fonts.json +0 -1754
- package/css-forms.json +0 -281
- package/css-gaps.json +0 -544
- package/css-gcpm-4.json +0 -58
- package/css-gcpm.json +0 -138
- package/css-grid-3.json +0 -335
- package/css-grid.json +0 -824
- package/css-images-4.json +0 -367
- package/css-images-5.json +0 -43
- package/css-images.json +0 -373
- package/css-inline.json +0 -903
- package/css-layout-api.json +0 -21
- package/css-line-grid.json +0 -142
- package/css-link-params.json +0 -34
- package/css-lists.json +0 -337
- package/css-logical.json +0 -396
- package/css-masking.json +0 -717
- package/css-mixins.json +0 -58
- package/css-multicol.json +0 -253
- package/css-namespaces.json +0 -25
- package/css-nav.json +0 -121
- package/css-nesting.json +0 -17
- package/css-overflow-4.json +0 -428
- package/css-overflow-5.json +0 -226
- package/css-overflow.json +0 -379
- package/css-overscroll.json +0 -215
- package/css-page-floats.json +0 -296
- package/css-page.json +0 -382
- package/css-paint-api.json +0 -17
- package/css-position-4.json +0 -49
- package/css-position.json +0 -495
- package/css-properties-values-api.json +0 -39
- package/css-pseudo.json +0 -98
- package/css-regions.json +0 -59
- package/css-rhythm.json +0 -181
- package/css-round-display.json +0 -85
- package/css-ruby.json +0 -221
- package/css-scoping.json +0 -38
- package/css-scroll-anchoring.json +0 -43
- package/css-scroll-snap-2.json +0 -74
- package/css-scroll-snap.json +0 -643
- package/css-scrollbars.json +0 -82
- package/css-shadow-parts.json +0 -17
- package/css-shapes-2.json +0 -89
- package/css-shapes.json +0 -384
- package/css-size-adjust.json +0 -50
- package/css-sizing-4.json +0 -601
- package/css-sizing.json +0 -427
- package/css-speech.json +0 -985
- package/css-syntax.json +0 -263
- package/css-tables.json +0 -91
- package/css-text-4.json +0 -1516
- package/css-text-decor-4.json +0 -741
- package/css-text-decor.json +0 -337
- package/css-text.json +0 -670
- package/css-transforms-2.json +0 -329
- package/css-transforms.json +0 -213
- package/css-transitions-2.json +0 -47
- package/css-transitions.json +0 -119
- package/css-ui.json +0 -818
- package/css-values-5.json +0 -854
- package/css-values.json +0 -790
- package/css-variables.json +0 -29
- package/css-view-transitions-2.json +0 -152
- package/css-view-transitions.json +0 -77
- package/css-viewport.json +0 -43
- package/css-will-change.json +0 -64
- package/css-writing-modes.json +0 -256
- package/fill-stroke.json +0 -755
- package/filter-effects-2.json +0 -28
- package/filter-effects.json +0 -220
- package/html.json +0 -29
- package/mathml-core.json +0 -69
- package/mediaqueries-5.json +0 -915
- package/mediaqueries.json +0 -549
- package/motion.json +0 -303
- package/pointer-animations.json +0 -282
- package/scroll-animations.json +0 -519
- package/selectors-5.json +0 -22
- package/selectors.json +0 -604
- package/svg-strokes.json +0 -59
- package/upgrade-insecure-requests.json +0 -28
- package/webvtt.json +0 -33
- package/webxr-dom-overlays.json +0 -17
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,23 @@ Webref adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
|
|
|
7
7
|
applied to data. A new major version is released whenever a breaking change is
|
|
8
8
|
made to the data structure.
|
|
9
9
|
|
|
10
|
+
## v7.0.0 - 2025-06
|
|
11
|
+
|
|
12
|
+
CSS extracts are now consolidated into a single file.
|
|
13
|
+
|
|
14
|
+
### Breaking changes
|
|
15
|
+
|
|
16
|
+
- A single consolidated `css.json` file replaces CSS extracts per spec.
|
|
17
|
+
|
|
18
|
+
### How to upgrade
|
|
19
|
+
|
|
20
|
+
In version 6, `listAll()` resolved with an object where the keys were spec shortnames, and the values mostly matched the structure of the consolidated object that the function now returns. On top of the consolidation itself, main differences are:
|
|
21
|
+
- Functions and types were merged in a `values` category in version 6, they now appear in separate `functions` and `types` categories.
|
|
22
|
+
- Functions and types that were scoped to another CSS feature appeared nested under that CSS feature in version 6. They now appear directly under `functions` and `types` with a `for` key that contains the name of the scoping feature.
|
|
23
|
+
- The shortname of the spec (or specs) that defines a feature is no longer readily available (but note the `href` key targets the defining spec). If you need the specs' shortnames, please [raise an issue](https://github.com/w3c/webref/issues) to describe your use case.
|
|
24
|
+
- The consolidation removes duplicates, merging extended definitions into a single feature. The definition from the latest spec level is used when a feature is defined in more than one level. If you need the definition from earlier levels, please [raise an issue](https://github.com/w3c/webref/issues) to describe your needs!
|
|
25
|
+
- Some of the possible values that a CSS feature could take appeared nested under that feature definition in a `values` key in version 6. Such values are no longer reported in the new version: they were confusing in any case because they did not cover the whole range of values that a feature could take, and could contain values that were not atomic keyword values. Values could be re-introduced when CSS specs are more systematic about them. In the meantime, you will need to parse the feature's syntax (the `value` key) to extract keyword values.
|
|
26
|
+
|
|
10
27
|
|
|
11
28
|
## v6.0.0 - 2022-11-28
|
|
12
29
|
|
package/README.md
CHANGED
|
@@ -1,46 +1,61 @@
|
|
|
1
1
|
# CSS definitions of the web platform
|
|
2
2
|
|
|
3
|
-
This package contains CSS
|
|
3
|
+
This package contains a consolidated list of CSS features defined across specs, scraped from the latest versions of web platform specifications in [webref](https://github.com/w3c/webref). Fixes are applied to ensure that [guarantees](#guarantees) hold, including the ability to parse syntaxes associated with CSS features with [CSSTree](https://github.com/csstree/csstree).
|
|
4
|
+
|
|
5
|
+
**Important:** If you're migrating from version 6, see the [changelog](CHANGELOG.md) for "How to upgrade" considerations.
|
|
4
6
|
|
|
5
7
|
# API
|
|
6
8
|
|
|
7
|
-
The async `listAll()` method resolves with an object
|
|
9
|
+
The async `listAll()` method resolves with an object that contains lists of features grouped by feature type: `atrules`, `functions`, `properties`, `selectors` and `types`. Example:
|
|
8
10
|
|
|
9
11
|
```js
|
|
10
12
|
const css = require('@webref/css');
|
|
11
13
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
const { atrules, functions, properties, selectors, types } = await css.listAll();
|
|
15
|
+
|
|
16
|
+
for (const feature of functions) {
|
|
17
|
+
// do something with the object that describes the CSS function
|
|
15
18
|
}
|
|
16
19
|
```
|
|
17
20
|
|
|
18
|
-
CSS
|
|
21
|
+
Each CSS feature is described by:
|
|
22
|
+
- a `name` key that contains the name of the feature
|
|
23
|
+
- an `href` key that contains the URL (with a fragment) of the CSS spec that defines the feature
|
|
24
|
+
|
|
25
|
+
Many CSS features also have a `value` key that describes the syntax of the feature, as defined in the spec. This syntax can be parsed with the [CSSTree Value Definition Syntax parser](https://github.com/csstree/csstree/blob/master/docs/definition-syntax.md#value-definition-syntax). Example:
|
|
19
26
|
|
|
20
27
|
```js
|
|
21
28
|
const css = require('@webref/css');
|
|
22
29
|
const { definitionSyntax } = require('css-tree');
|
|
23
30
|
|
|
24
|
-
const
|
|
25
|
-
for (const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
try {
|
|
29
|
-
const ast = definitionSyntax.parse(property.value);
|
|
30
|
-
// do something with the ast
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
33
|
-
// one of the few value definitions that cannot yet be parsed by CSSTree
|
|
34
|
-
}
|
|
35
|
-
}
|
|
31
|
+
const { properties } = await css.listAll();
|
|
32
|
+
for (const property of properties) {
|
|
33
|
+
if (!property.value) {
|
|
34
|
+
continue;
|
|
36
35
|
}
|
|
36
|
+
const ast = definitionSyntax.parse(property.value);
|
|
37
|
+
// do something with the abstract syntax tree
|
|
37
38
|
}
|
|
38
39
|
```
|
|
39
40
|
|
|
41
|
+
Additional keys may be set depending on the type of the CSS feature. For example:
|
|
42
|
+
|
|
43
|
+
- At-rules have a `descriptors` key that contains the list of descriptors defined for the given at-rule.
|
|
44
|
+
- Functions and types that are scoped to a property or other feature have a `for` key that contains the name of the scoping property or other feature.
|
|
45
|
+
- Properties have a `styleDeclaration` key that contains the list of IDL attribute names that the property generates. A number of other keys may be set to describe the property's initial value, animation type and other parameters.
|
|
46
|
+
|
|
47
|
+
Additional notes:
|
|
48
|
+
- Type names are enclosed in `<>`. For example: `<frequency-percentage>`.
|
|
49
|
+
- When a feature is defined across different levels in the same spec series, the definition from the latest level is used.
|
|
50
|
+
- When a property is extended with new values in different specs, `href` links to the base definition and `value` is the union (using `|`) of the syntaxes of the base and extended definitions.
|
|
51
|
+
- When new descriptors are defined for an at-rule in different specs, `descriptors` contains the merged list of known descriptors.
|
|
52
|
+
- When specs define the syntax of an at-rule in terms of `<declaration-list>` or `<declaration-rule-list>`, the `value` key contains an "expanded" syntax that leverages the syntax of the at-rule's descriptors.
|
|
53
|
+
|
|
40
54
|
# Guarantees
|
|
41
55
|
|
|
42
56
|
The following guarantees are provided by this package:
|
|
43
|
-
- All values
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
|
|
57
|
+
- All syntax values (the `value` keys) can be parsed by the version of [CSSTree](https://github.com/csstree/csstree) set in `peerDependencies` in `package.json`.
|
|
58
|
+
- Feature names (the `name` keys) are unique per type provided that the `for` key is also taken into account for functions and types.
|
|
59
|
+
- All features have an `href` key that targets the CSS spec that defines the feature. When the feature is extended across CSS specs, this URL targets the base definition.
|
|
60
|
+
|
|
61
|
+
*Note:* there is no guarantee that functions, properties and types referenced by other constructs actually exist. The grammar is known to be incomplete.
|