@lwc/style-compiler
Advanced tools
Comparing version 6.2.0 to 6.2.1
@@ -476,4 +476,5 @@ /** | ||
* Add scoping attributes to all the matching selectors: | ||
* h1 -> h1[x-foo_tmpl] | ||
* p a -> p[x-foo_tmpl] a[x-foo_tmpl] | ||
* - h1 -> h1[x-foo_tmpl] | ||
* - p a -> p[x-foo_tmpl] a[x-foo_tmpl] | ||
* @param selector | ||
*/ | ||
@@ -537,4 +538,5 @@ function scopeSelector(selector) { | ||
* contextual selector it will generate a rule for each of them. | ||
* :host -> [x-foo_tmpl-host] | ||
* :host(.foo, .bar) -> [x-foo_tmpl-host].foo, [x-foo_tmpl-host].bar | ||
* - `:host -> [x-foo_tmpl-host]` | ||
* - `:host(.foo, .bar) -> [x-foo_tmpl-host].foo, [x-foo_tmpl-host].bar` | ||
* @param selector | ||
*/ | ||
@@ -746,3 +748,3 @@ function transformHost(selector) { | ||
/* | ||
* Copyright (c) 2018, salesforce.com, inc. | ||
* Copyright (c) 2024, Salesforce, Inc. | ||
* All rights reserved. | ||
@@ -752,2 +754,19 @@ * SPDX-License-Identifier: MIT | ||
*/ | ||
/** | ||
* Transforms CSS for use with LWC components. | ||
* @param src Contents of the CSS source file | ||
* @param id Filename of the CSS source file | ||
* @param config Transformation options | ||
* @returns Transformed CSS | ||
* @example | ||
* const {transform} = require('@lwc/style-compiler'); | ||
* const source = ` | ||
* :host { | ||
* opacity: 0.4; | ||
* } | ||
* span { | ||
* text-transform: uppercase; | ||
* }`; | ||
* const { code } = transform(source, 'example.css'); | ||
*/ | ||
function transform(src, id, config = {}) { | ||
@@ -765,3 +784,3 @@ if (src === '') { | ||
exports.transform = transform; | ||
/** version: 6.2.0 */ | ||
/** version: 6.2.1 */ | ||
//# sourceMappingURL=index.cjs.js.map |
@@ -472,4 +472,5 @@ /** | ||
* Add scoping attributes to all the matching selectors: | ||
* h1 -> h1[x-foo_tmpl] | ||
* p a -> p[x-foo_tmpl] a[x-foo_tmpl] | ||
* - h1 -> h1[x-foo_tmpl] | ||
* - p a -> p[x-foo_tmpl] a[x-foo_tmpl] | ||
* @param selector | ||
*/ | ||
@@ -533,4 +534,5 @@ function scopeSelector(selector) { | ||
* contextual selector it will generate a rule for each of them. | ||
* :host -> [x-foo_tmpl-host] | ||
* :host(.foo, .bar) -> [x-foo_tmpl-host].foo, [x-foo_tmpl-host].bar | ||
* - `:host -> [x-foo_tmpl-host]` | ||
* - `:host(.foo, .bar) -> [x-foo_tmpl-host].foo, [x-foo_tmpl-host].bar` | ||
* @param selector | ||
*/ | ||
@@ -742,3 +744,3 @@ function transformHost(selector) { | ||
/* | ||
* Copyright (c) 2018, salesforce.com, inc. | ||
* Copyright (c) 2024, Salesforce, Inc. | ||
* All rights reserved. | ||
@@ -748,2 +750,19 @@ * SPDX-License-Identifier: MIT | ||
*/ | ||
/** | ||
* Transforms CSS for use with LWC components. | ||
* @param src Contents of the CSS source file | ||
* @param id Filename of the CSS source file | ||
* @param config Transformation options | ||
* @returns Transformed CSS | ||
* @example | ||
* const {transform} = require('@lwc/style-compiler'); | ||
* const source = ` | ||
* :host { | ||
* opacity: 0.4; | ||
* } | ||
* span { | ||
* text-transform: uppercase; | ||
* }`; | ||
* const { code } = transform(source, 'example.css'); | ||
*/ | ||
function transform(src, id, config = {}) { | ||
@@ -761,3 +780,3 @@ if (src === '') { | ||
export { transform }; | ||
/** version: 6.2.0 */ | ||
/** version: 6.2.1 */ | ||
//# sourceMappingURL=index.js.map |
@@ -0,5 +1,6 @@ | ||
/** Configuration options for CSS transforms. */ | ||
export interface Config { | ||
/** | ||
* @deprecated - Custom property transforms are deprecated because IE11 and other legacy browsers are no longer supported. | ||
* CSS custom properties configuration | ||
* @deprecated Custom property transforms are deprecated because IE11 and other legacy browsers are no longer supported. | ||
*/ | ||
@@ -17,4 +18,21 @@ customProperties?: { | ||
} | ||
/** | ||
* Transforms CSS for use with LWC components. | ||
* @param src Contents of the CSS source file | ||
* @param id Filename of the CSS source file | ||
* @param config Transformation options | ||
* @returns Transformed CSS | ||
* @example | ||
* const {transform} = require('@lwc/style-compiler'); | ||
* const source = ` | ||
* :host { | ||
* opacity: 0.4; | ||
* } | ||
* span { | ||
* text-transform: uppercase; | ||
* }`; | ||
* const { code } = transform(source, 'example.css'); | ||
*/ | ||
export declare function transform(src: string, id: string, config?: Config): { | ||
code: string; | ||
}; |
@@ -7,3 +7,3 @@ { | ||
"name": "@lwc/style-compiler", | ||
"version": "6.2.0", | ||
"version": "6.2.1", | ||
"description": "Transform style sheet to be consumed by the LWC engine", | ||
@@ -46,4 +46,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@lwc/shared": "6.2.0", | ||
"postcss": "~8.4.33", | ||
"@lwc/shared": "6.2.1", | ||
"postcss": "~8.4.35", | ||
"postcss-selector-parser": "~6.0.15", | ||
@@ -50,0 +50,0 @@ "postcss-value-parser": "~4.2.0" |
@@ -23,3 +23,3 @@ # @lwc/style-compiler | ||
```js | ||
const compile = require('@lwc/style-compiler'); | ||
const { transform } = require('@lwc/style-compiler'); | ||
@@ -36,3 +36,3 @@ const source = ` | ||
const { code } = compile(source, 'example.css'); | ||
const { code } = transform(source, 'example.css'); | ||
``` | ||
@@ -42,3 +42,3 @@ | ||
#### `compile(source, id, options)` | ||
#### `transform(source, id, options)` | ||
@@ -45,0 +45,0 @@ **Options:** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
118483
1609
+ Added@lwc/shared@6.2.1(transitive)
- Removed@lwc/shared@6.2.0(transitive)
Updated@lwc/shared@6.2.1
Updatedpostcss@~8.4.35