Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Work-in-progress CSS preprocessor. Spiritual successor of Stylus. Built on top of Rework.
Styl is basically an opinionated configuration of Rework. It does not aim for feature parity with Stylus.
If your application benefits from a runtime (conditionals, loops etc.), then Stylus is for you. If your application benefits from incredibly fast builds, simplicity, and the most transparent CSS preprocessor around, then Styl is for you.
Building Styl on top of Rework drastically reduces complexity. That’s because Rework is comprised of multiple smaller pieces, plugins, and has no complex runtime. If you wish to include custom plugins, or configure Styl beyond its defaults, the interface is the same as Rework.
$ npm install -g styl
or with component:
$ component install component/styl
or with a script tag using ./styl.js
All Rework features and plugins are available out-of-the-box, including:
rgba(#fc0, .5)
)height: @width
)Usage: styl [options]
Options:
-h, --help output usage information
-V, --version output the version number
-v, --vendors <list> vendor prefixes to apply [o,ms,moz,webkit]
-w, --whitespace use significant whitespace pre-processor
-c, --compress use output compression
Regular CSS, with no vendor prefixing:
#logo {
width: 50px;
height: @width;
absolute: top 100px left 50%;
background: linear-gradient(top, black, white);
}
Compiled with the following command:
$ styl < simple.css > out.css
Yields:
#logo {
width: 50px;
height: 50px;
position: absolute;
top: 100px;
left: 50%;
background: -o-linear-gradient(top, black, white);
background: -ms-linear-gradient(top, black, white);
background: -moz-linear-gradient(top, black, white);
background: -webkit-linear-gradient(top, black, white);
background: linear-gradient(top, black, white)
}
The SASS-style (significant whitespace) syntax supports nesting and parent selector references. Currently, the CSS style does not; however this is likely to change in the future.
ul
margin: 0
li
list-style: none
a
display: block
text-decoration: none
padding: 5px 10px
&:hover
text-decoration: underline
Compiled with the following command:
$ styl -w < simple.styl > out.css
Yields:
ul {
margin: 0
}
ul li a:hover {
text-decoration: underline
}
ul li a {
display: block;
text-decoration: none;
padding: 5px 10px
}
ul li {
list-style: none
}
Initialize a new Styl
with the given string
of regular CSS or
whitespace-significant style CSS with the following options:
whitespace
enable css whitespace [false]compress
enable output compression [false]var styl = require('styl');
var css = styl('body\n color: blue', { whitespace: true }).toString();
Convert to CSS.
Projects built with Styl:
Build tools implementing Styl:
MIT
FAQs
CSS pre-processor built on Rework
The npm package styl receives a total of 0 weekly downloads. As such, styl popularity was classified as not popular.
We found that styl demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.