![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
theme-builder
Advanced tools
Build theme's variables form YAML to consumable format (like JS or SCSS)
npm install theme-builder
const themeBuilder = require('theme-builder');
const builder = themeBuilder({
format: 'scss',
prefix: 'tx',
});
builder.build(pathToYamlFile)
.then(themeScss => console.log(themeScss));
js
- just a plain javascript objectscss
- SCSS variablesYou have index.yaml
and you want to convert it to SCSS:
generic:
color:
accent: &accent '#1fcff6'
button:
color:
bg: *accent
So, you can call themeBuilder
function like this:
themeBuilder({ format: 'scss' })
.build('index.yaml')
.then(themeScss => console.log(themeScss));
and as result you will get string with 2 variables:
$ui-generic-color-accent: #1fcff6;
$ui-button-color-bg: #1fcff6;
You can save the output to .scss
file and use while writing your styles.
You can provide array of yaml files, and themeBuilder will merge it one by one:
You have default.yaml
and custom.yaml
, you want to merge it and convert it to SCSS:
./default.yaml
generic:
color:
accent: &accent '#1fcff6'
button:
color:
bg: *accent
./custom.yaml
generic:
color:
accent: &accent '#283A8E'
themeBuilder()
.build(['default.yaml', 'custom.yaml'])
.then(themeScss => console.log(themeScss));
and as result you will get string with 2 variables:
$ui-generic-color-accent: #283A8E;
$ui-button-color-bg: #283A8E;
themeBuilder()
.watch(['default.yaml', 'custom.yaml'], updatedTemeScss => console.log(updatedTemeScss));
function themeBuilder(
// Path to main theme YAML file
themeYaml: string,
// Output format
format: string,
// Optional config
config?: Config
): any
type Config = {
// Processors for additional formats
processors?: {[name: string]: Processor},
// Output unit prefixes, eg. SCSS variables names prefixes
prefix?: string,
}
type Processor = {
compile(obj: object): any
}
FAQs
README
We found that theme-builder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.