-
-
Save paulmillr/2005644 to your computer and use it in GitHub Desktop.
.border-radius (@radius) { | |
-webkit-border-radius: @radius; | |
-o-border-radius: @radius; | |
-moz-border-radius: @radius; | |
-ms-border-radius: @radius; | |
border-radius: @radius; | |
} | |
.user-list { | |
// need to use special `.` syntax | |
.border-radius(10px); | |
} |
@mixin border-radius($radius) | |
-webkit-border-radius: $radius | |
-o-border-radius: $radius | |
-moz-border-radius: $radius | |
-ms-border-radius: $radius | |
border-radius: $radius | |
.user-list | |
// need to use special `@` syntax | |
@include border-radius(10px) |
// This and all CSS3 funcs are included in `nib` stylus plugin. | |
border-radius() | |
-webkit-border-radius: arguments | |
-o-border-radius: arguments | |
-moz-border-radius: arguments | |
-ms-border-radius: arguments | |
border-radius: arguments | |
.user-list | |
border-radius: 10px | |
// or | |
.user-list { | |
border-radius: 10px; | |
} |
Extremely late here, but I must raise an issue that seriously bugs novices (like me).
On one hand you have Stylus, with its minimal required syntax, flexibility, and incredible features (like functions, for instance). The pythonic syntax is incredible, allowing me to truly enjoy writing CSS. I'm sure many others feel the same.
However, when you look at the number of materials available for the preprocessor.. well, it's almost null. The documentation is excellent as far as documentations go, and I've also found an excellent tutorial for stylus by LevelUp Tuts on youtube. Besides that, all I could find are some articles. There's good frameworks like Kuoto Swiss but there doesn't seem to be much material on the same.
On the other hand, there's certainly an ample amount of material for one wishing to learning sass (more specifically the SCSS syntax..), Compass, and even Susy. It's worth mentioning that Bootstrap and Foundation both provide Sass support. There's also so many more frameworks and mixin libraries available for Sass..
Books on Responsive Web Design tend to glorify SASS but don't seem to mention Stylus at all, for the most part.
For those starting out who like stylus, it's a bit of a bummer imo.
I was about to decide on Stylus becasue the mixins are simple to write and since i already know Sass. But now after JunTheProgrammer comment i am worried to use stylus or go with Sass only
@JunTheProgrammer, it's only CSS ultimately, though. Do we really need endless repeated articles on how to write a mixin? The Stylus documentation has everything you need.
It's worth noting that Stylus is no longer in development at the time of writing. The last commit was on July 18th, 2016 (https://github.com/stylus/stylus). SASS/SCSS is still under active development with the last commit made 5 days ago at the time of writing (https://github.com/sass/sass). At this point in time SASS/SCSS has feature parity with Sylus if not more. In this situation I am more willing to develop using a technology still being updated over a project which has not seen an update in almost a year. I don't buy the excuse that Stylus is no longer being updated because it is feature complete either.
I like the look and feel of stylus idk why. I'm on the fence between sass and stylus atm though not sure which one is gonig to with the race in my mind! @paulmillr