@tenoxui/static-css v1.0.0
Static TenoxUI CSS Generator
TenoxUI CSS Generator is a powerful and flexible tool that automatically generates CSS rules from class names found in your HTML or JSX. It allows you to define custom properties, values, and classes, making it easy to create and maintain a consistent styling system across your project (tenoxui but css).
Features
- Utility-first
- Generates CSS rules from class names
- Generates only what you define
- Support all css value and unit
- Support all tenoxui class definitions
- Small, fast, easy to configure
Installation
npm install @tenoxui/static-cssUsage
Adding a Config
Create a configuration file (e.g., tenoxui.config.js or define with extensions .mjs/.cjs):
module.exports = {
// input file
input: ['index.html', 'src/**/*.jsx'],
// where's the output should written
output: 'dist/styles.css',
property: {
// regular type & property
bg: 'backgroundColor',
text: 'color',
p: 'padding',
br: 'borderRadius',
// multiple property
size: ['width', 'height'],
// variable property
'border-color': '--bdr-clr',
// custom value property
gradient: {
property: 'backgroundImage',
value: 'linear-gradient(to right, purple, {value})'
},
flex: {
property: ['justifyContent', 'alignItems'],
value: '{value}'
}
},
// custom value
values: {
primary: '#ccf654', // usage _ text-primary = .text-primary { color: #ccf654; }
rex: '#0000ff'
},
// custom classes. property-based className
classes: {
display: {
'se-flex': 'flex',
iflex: 'inline-flex', // .iflex { display: inline-flex; }
'b-tenox': 'block'
},
alignItems: {
'se-flex': 'center'
}
// output `se-flex` _ .se-flex { display: flex; align-items: center; }
}
}input: Array of glob patterns for input filesoutput: Path for the generated CSS fileproperty: Define custom property mappingsvalues: Define custom value mappingsclasses: Define custom class definitions
CLI Mode
▶ npx tui-css -h
Usage: tui-css [options]
Options:
-V, --version output the version number
-c, --config <path> Path to the configuration file
-w, --watch Watch for file changes
-o, --output <path> Output file path (overrides config file)
-v, --verbose Verbose output
--init Initialize a new configuration file
-h, --help display help for command--initUsing
--initflag will generatetenoxui.config.jstemplate inside your project.-cor--configSet the path to the tenoxui config. Example:
tui-css -c tenoxui.config.mjstui-css --config tenoxui.config.cjs-oor--outputSet output file path. Example:
tui-css -o dist/output.csstui-css --output src/css/index.css-wor--watchUse watch mode. Example:
tui-css -wtui-css --watch-vor--verboseDisplaying slight preview for generated css. Example:
tui-css -vtui-css --verbose
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago