Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Stylus is a robust, expressive, and feature-rich CSS preprocessor that provides a powerful and efficient way to write CSS. It supports both an indented syntax and regular CSS style. Stylus helps in writing clean and manageable stylesheets, allowing the use of variables, mixins, functions, and many other techniques that make CSS more maintainable and extendable.
Variables
Variables in Stylus allow you to store values that can be reused throughout your stylesheet. This example defines a variable 'main-color' and applies it to the body's text color.
main-color = #333
body
color main-color
Mixins
Mixins in Stylus are a way to create reusable sets of properties. This mixin 'border-radius' applies the border radius across different browser prefixes and is used in a button.
border-radius(radius)
-webkit-border-radius radius
-moz-border-radius radius
border-radius radius
button
border-radius(5px)
Nesting
Nesting allows you to nest your CSS selectors in a way that follows the same visual hierarchy of your HTML. This example shows how to style a navigation bar using nesting.
nav
ul
margin 0
padding 0
list-style none
li
display inline-block
a
display block
padding 6px 12px
text-decoration none
Functions
Functions in Stylus can be defined to perform operations and can be used throughout the stylesheet. This example defines a simple 'add' function to calculate the sum of two values, used here to set padding.
add(a, b)
a + b
div
padding add(10px, 5px)
Sass (Syntactically Awesome Style Sheets) is a CSS preprocessor similar to Stylus, offering features like variables, mixins, and nesting. Sass tends to have a larger community and more extensive framework support compared to Stylus.
Less (Leaner Style Sheets) is another CSS preprocessor that shares many features with Stylus, such as variables, mixins, and nesting. Less is often noted for its simplicity and ease of integration with other projects.
PostCSS is a tool for transforming CSS with JavaScript plugins. While it serves a different primary purpose compared to Stylus, it can be extended to offer similar functionalities through various plugins.
Stylus is a revolutionary new language, providing an efficient, dynamic, and expressive way to generate CSS. Supporting both an indented syntax and regular CSS style.
You can sponsor stylus ongoing development via opencollective or paypal !
Your Logo |
$ npm install stylus -g
Watch and compile a stylus file from command line with
stylus -w style.styl -o style.css
You can also try all stylus features on stylus-lang.com, build something with stylus on codepen or RunKit
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Please read our Contribution Guide before making any pull requests to the project. Included are directions for opening issues, workflows, and coding standards.
Thank you to all the people who already contributed to Stylus!
Copyright (c) 2010-present TJ and Stylus maintainers
FAQs
Robust, expressive, and feature-rich CSS superset
The npm package stylus receives a total of 2,242,283 weekly downloads. As such, stylus popularity was classified as popular.
We found that stylus demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.