
Security News
CISA Extends MITRE Contract as Crisis Accelerates Alternative CVE Coordination Efforts
CISA extended MITRE’s CVE contract by 11 months, avoiding a shutdown but leaving long-term governance and coordination issues unresolved.
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
The npm package theme-builder receives a total of 0 weekly downloads. As such, theme-builder popularity was classified as not popular.
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
CISA extended MITRE’s CVE contract by 11 months, avoiding a shutdown but leaving long-term governance and coordination issues unresolved.
Product
Socket's Rubygems ecosystem support is moving from beta to GA, featuring enhanced security scanning to detect supply chain threats beyond traditional CVEs in your Ruby dependencies.
Research
The Socket Research Team investigates a malicious npm package that appears to be an Advcash integration but triggers a reverse shell during payment success, targeting servers handling transactions.