https://github.com/stylecow/stylecow-core
The core of stylecow
https://github.com/stylecow/stylecow-core
css deno preprocessor stylecow
Last synced: about 1 year ago
JSON representation
The core of stylecow
- Host: GitHub
- URL: https://github.com/stylecow/stylecow-core
- Owner: stylecow
- License: mit
- Created: 2015-02-01T20:27:06.000Z (over 11 years ago)
- Default Branch: deno
- Last Pushed: 2020-11-01T17:20:55.000Z (over 5 years ago)
- Last Synced: 2025-03-26T17:51:55.607Z (about 1 year ago)
- Topics: css, deno, preprocessor, stylecow
- Language: CSS
- Homepage: http://stylecow.github.io/
- Size: 7.13 MB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Stylecow core
Fast and furious css processor. For Deno
Simple usage example:
```javascript
import { parseFile, Task, Coder } from 'https://deno.land/x/stylecow_core/mod.js';
import importPlugin from 'https://deno.land/x/stylecow_import/mod.js';
import nestedRulesPlugin from 'https://deno.land/x/stylecow_nested_rules/mod.js';
//Create a Tasks instance and add some plugins
const tasks = new Tasks()
.use(importPlugin)
.use(nestedRulesPlugin)
//custom tasks
.addTask({
filter: {
type: 'Keyword',
name: 'grey'
},
fn: keyword => keyword.name = 'gray'
});
//Create a Coder instance to minify the css code
const coder = new Coder('minify');
//Parse a css file
const css = parseFile('styles.css');
//Execute the tasks
tasks.run(css);
//Get the minified code
const code = coder.run(css);
console.log(code.css);
```