@enhance/arc-plugin-styles
Advanced tools
Comparing version 0.0.6 to 0.0.7
{ | ||
"name": "@enhance/arc-plugin-styles", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Plugin for generating enhance CSS utility classes", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -34,36 +34,1 @@ # `arc-plugin-styles` | ||
``` | ||
### getStyles | ||
Call the `getStyles` function to get either a link tag or a style tag for your utility css file. | ||
It takes two arguments, the name of your output utility css file and a configuration object for enhance styles. | ||
``` | ||
const stylesFileName = 'utility-classes.css' | ||
const config = { | ||
base: 20, | ||
scale: { | ||
ratio: 'goldenRatio', | ||
steps: 12 | ||
}, | ||
fonts: { | ||
sans: "system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif", | ||
serif: "Georgia,Cambria,Times New Roman,Times,serif", | ||
mono: "Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace" | ||
}, | ||
base: 20, | ||
steps: 8, | ||
theme: { | ||
light: "#fff", | ||
dark: "#222", | ||
primary: "#1f74d6", | ||
secondary: "#7327ce", | ||
success: "#2cdd93", | ||
info: "#2196f3", | ||
warning: "#ffeb3b", | ||
error: "#e21893" | ||
} | ||
} | ||
const styles = getStyles(stylesFileName, config) | ||
console.log(styles) | ||
``` |
@@ -54,11 +54,21 @@ // eslint-disable-next-line | ||
let stylesConfig = '{}' | ||
let pathToConfig | ||
if (pluginConfig.config) { | ||
const pathToConfig = path.join( | ||
pathToConfig = path.join( | ||
inventory.inv._project.cwd, | ||
pluginConfig.config, | ||
) | ||
stylesConfig = readFileSync(pathToConfig, 'utf-8') | ||
} | ||
else { | ||
pathToConfig = path.join( | ||
__dirname, | ||
'node_modules', | ||
'@enhance', | ||
'styles', | ||
'config.json' | ||
) | ||
} | ||
let stylesConfig = readFileSync(pathToConfig, 'utf-8') | ||
return { | ||
@@ -65,0 +75,0 @@ stylesConfig, |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
89
15747
34
1