Add commands to extract scss properties into Otter variables
Otter: Extract SCSS property to o3r.variable
: extract a single pair property/value into an otter variablemust be on the line on which you want to perform the command
Otter: Extract all SCSS properties to o3r.variable
: extract all the matches properties and values into otter variablesThis extension can be configured the following settings:
otter.extract.styling.forbiddenWords
: Array of words to exclude from the final result of a generated variableotter.extract.styling.prefix
: If not empty, will add a prefix to all the generated variables.Before
Example :// in app-header.scss file
.app-header-class {
.title-text {
color: red;
}
}
Use the command Otter: Extract SCSS property to o3r-var
where the cursor is set
must be on the line on which you want to perform the command
After
Example :// in app-header.scss file
@use "@o3r/styling" as o3r;
$app-header-title-text-color: o3r.variable("app-header-title-text-color", red);
.app-header-class {
.title-text {
color: $app-header-title-text-color;
}
}
with the following configuration
Example :"otter.extract.styling.prefix": "app" // default: ""