@lwc/style-compiler 8.11.0 → 8.12.0

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -4,12 +4,12 @@ Transform style sheet to be consumed by the LWC engine.
4
4
 
5
5
  ## Features
6
6
 
7
- - Shadow DOM style scoping:
8
- - transform `:host` pseudo-class selectors
9
- - scope all the other selectors using CSS attribute selectors
10
- - Custom Properties: inline replacement of `var()` CSS function
11
- - Right-to-left: transform the `:dir` pseudo class selector to `[dir]` attribute selectors
12
- - CSS import: resolve imports via static ES module imports
7
+ - Shadow DOM style scoping:
8
+ - transform `:host` pseudo-class selectors
9
+ - scope all the other selectors using CSS attribute selectors
10
+ - Custom Properties: inline replacement of `var()` CSS function
11
+ - Right-to-left: transform the `:dir` pseudo class selector to `[dir]` attribute selectors
12
+ - CSS import: resolve imports via static ES module imports
13
13
 
14
14
  ## Installation
15
15
 
@@ -41,27 +41,27 @@ const { code } = transform(source, 'example.css');
41
41
 
42
42
  **Options:**
43
43
 
44
- - `source` (string, required) - the css source file to compiler
45
- - `id` (string, required) - the css source file path, used by the compiler to produce errors with the file name
46
- - `options` (object, optional)
47
- - `customProperties` (object, optional)
48
- - `resolverModule` (boolean, optional) - module name for the custom properties resolve
49
- - `scoped` (boolean, optional) - true if the styles are scoped (via Light DOM style scoping)
50
- - `disableSyntheticShadowSupport` (boolean, optional) - true if synthetic shadow DOM support is not needed, which can result in smaller output
51
- - `apiVersion` (number, optional) - API version to associate with the compiled stylesheet.
44
+ - `source` (string, required) - the css source file to compiler
45
+ - `id` (string, required) - the css source file path, used by the compiler to produce errors with the file name
46
+ - `options` (object, optional)
47
+ - `customProperties` (object, optional)
48
+ - `resolverModule` (boolean, optional) - module name for the custom properties resolve
49
+ - `scoped` (boolean, optional) - true if the styles are scoped (via Light DOM style scoping)
50
+ - `disableSyntheticShadowSupport` (boolean, optional) - true if synthetic shadow DOM support is not needed, which can result in smaller output
51
+ - `apiVersion` (number, optional) - API version to associate with the compiled stylesheet.
52
52
 
53
53
  **Return:**
54
54
 
55
- - `code` - the generated code
55
+ - `code` - the generated code
56
56
 
57
57
  Note: The LWC style compiler doesn't preserve the authored format, and always produce compressed code.
58
58
 
59
59
  ## Selector scoping caveats
60
60
 
61
- - No support for [`::slotted`](https://drafts.csswg.org/css-scoping/#slotted-pseudo) pseudo-element.
62
- - No support for [`>>>`](https://drafts.csswg.org/css-scoping/#deep-combinator) deep combinator (spec still under consideration: [issue](https://github.com/w3c/webcomponents/issues/78)).
63
- - No support for [`:host-context`](https://drafts.csswg.org/css-scoping/#selectordef-host-context) pseudo-selector (browser vendors are not able to agree: [webkit](https://bugs.webkit.org/show_bug.cgi?id=160038), [gecko](https://bugzilla.mozilla.org/show_bug.cgi?id=1082060))
64
- - This transform duplicates the `:host` selector to able to use the generated style in both the synthetic and native shadow DOM. The duplication is necessary to support the functional form of `:host()`, `:host(.foo, .bar) {}` needs to get transformed into `.foo[x-btn-host], .bar[x-btn-host] {}` to work in the synthetic shadow DOM.
65
- - Scoped CSS has a non-negligeable performance impact:
66
- - Each selector chain is scoped and each compound expression passed to the `:host()` need to be spread into multiple selectors. This transformation greatly increases the overall size and complexity of the generated CSS, leading to more bits on the wire, longer parsing time and longer style recalculation.
67
- - In order to ensure CSS encapsulation, each element needs to add an extra attribute. This increases the actual rendering time.
61
+ - No support for [`::slotted`](https://drafts.csswg.org/css-scoping/#slotted-pseudo) pseudo-element.
62
+ - No support for [`>>>`](https://drafts.csswg.org/css-scoping/#deep-combinator) deep combinator (spec still under consideration: [issue](https://github.com/w3c/webcomponents/issues/78)).
63
+ - No support for [`:host-context`](https://drafts.csswg.org/css-scoping/#selectordef-host-context) pseudo-selector (browser vendors are not able to agree: [webkit](https://bugs.webkit.org/show_bug.cgi?id=160038), [gecko](https://bugzilla.mozilla.org/show_bug.cgi?id=1082060))
64
+ - This transform duplicates the `:host` selector to able to use the generated style in both the synthetic and native shadow DOM. The duplication is necessary to support the functional form of `:host()`, `:host(.foo, .bar) {}` needs to get transformed into `.foo[x-btn-host], .bar[x-btn-host] {}` to work in the synthetic shadow DOM.
65
+ - Scoped CSS has a non-negligeable performance impact:
66
+ - Each selector chain is scoped and each compound expression passed to the `:host()` need to be spread into multiple selectors. This transformation greatly increases the overall size and complexity of the generated CSS, leading to more bits on the wire, longer parsing time and longer style recalculation.
67
+ - In order to ensure CSS encapsulation, each element needs to add an extra attribute. This increases the actual rendering time.
package/dist/index.cjs.js CHANGED
@@ -804,5 +804,5 @@ function transform(src, id, config = {}) {
804
804
  }
805
805
 
806
806
  exports.transform = transform;
807
- /** version: 8.11.0 */
807
+ /** version: 8.12.0 */
808
808
  //# sourceMappingURL=index.cjs.js.map
package/dist/index.js CHANGED
@@ -800,5 +800,5 @@ function transform(src, id, config = {}) {
800
800
  }
801
801
 
802
802
  export { transform };
803
- /** version: 8.11.0 */
803
+ /** version: 8.12.0 */
804
804
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
5
5
  ],
6
6
  "name": "@lwc/style-compiler",
7
- "version": "8.11.0",
7
+ "version": "8.12.0",
8
8
  "description": "Transform style sheet to be consumed by the LWC engine",
9
9
  "keywords": [
10
10
  "lwc"
@@ -22,6 +22,9 @@
22
22
  "publishConfig": {
23
23
  "access": "public"
24
24
  },
25
+ "volta": {
26
+ "extends": "../../../package.json"
27
+ },
25
28
  "main": "dist/index.cjs.js",
26
29
  "module": "dist/index.js",
27
30
  "types": "dist/index.d.ts",
@@ -42,7 +45,7 @@
42
45
  }
43
46
  },
44
47
  "dependencies": {
45
- "@lwc/shared": "8.11.0",
48
+ "@lwc/shared": "8.12.0",
46
49
  "postcss": "~8.4.49",
47
50
  "postcss-selector-parser": "~7.0.0",
48
51
  "postcss-value-parser": "~4.2.0"