Skip to main content

Home/ CSS Evangelist/ Group items tagged mixins

Rss Feed Group items tagged

Vernon Fowler

Battle of the LESS Mixin Libraries: LESS Elements vs. LESS Hat vs. Bootstrap | Design S... - 0 views

  •  
    LESS is a friendly, easily-approachable CSS preprocessor. Though ultimately, Sass and Stylus are more powerful and robust, LESS has a certain charm that keeps it as a forerunner in the battle of the preprocessors. If you're a Sass fan, then you can take advantage of Compass, an incredible framework that makes coding with complex CSS3 properties a breeze. But what about LESS users? Where's their Compass? Today we'll look at three awesome mixin libraries that will help fill that void.
Vernon Fowler

An introduction to LESS, and comparison to Sass | Smashing Coding - 0 views

  • The only difference in variables between LESS and Sass is that, while LESS uses @, Sass uses $. There are some scope differences as well, which I’ll get to shortly.
  • With Sass, you declare @mixin prior to the style to identify it as a mixin. Later, you declare @include to call it.
  • Parametric Mixins Like having functions in your CSS (*swoon*), these can be immensely useful for those seemingly redundant tasks of modern-day CSS.
  • ...8 more annotations...
  • .border-radius( @radius: 3px ) { -webkit-border-radius: @radius; -moz-border-radius: @radius; border-radius: @radius; }
  • The syntax in Sass is very similar to that of LESS. Just use the $ for variables, and call the mixins with the @mixin and @include method mentioned earlier.
  • Selector Inheritance Here’s something not provided in LESS. With this ability, you can append a selector to a previously established selector without the need to add it in a comma-separated format. .menu { border: 1px solid #ddd; } .footer { @extend .menu; } /* will render like so: */ .menu, .footer { border: 1px solid #ddd; }
  • With LESS, you can nest ids, classes and elements as you go.
  • You can also refer in element styles to their pseudo-elements by using the &, which in this case functions similar to this in JavaScript.
  • Sass is a lot more versatile with numbers than LESS. It has built into it conversion tables to combine comparable units.
  • Sass seems to have a lot more color options — not that I would need them all. Lighten and darken are the only ones that I see myself using often.
  • Conditionals and Control This is rather nifty, and another thing not provided by LESS. With Sass, you have the ability to use if { } else { } conditional statements, as well as for { } loops. It supports and, or and not, as well as the <, >, <=, >= and == operators.
Gary Edwards

Introducing LESS: a Better CSS « Usability Post - 0 views

  •  
    Some bright folks also feel the same pain and went ahead and built meta-languages and compilers that take their own version of CSS and compile it to standard CSS code. Their own CSS meta-language is thus able to have new features, like variables, mixins, operations and so on. The most notable of these right now is SASS (part of HAML). I've tried SASS and really liked it, but one thing really bothered me. I didn't like how all the syntax was different to CSS. Sure, it's not CSS anymore, it's SASS, but do we really need to change the syntax of the stuff already present in CSS - why not just expand it? I've asked a friend of mine who is much more competent at programming than me about how long it would take to code a CSS compiler that retained the original CSS syntax but added a bunch of new features. He liked the idea and so we've put together our own version of CSS together with a compiler we call LESS, which stands for Leaner CSS.
Vernon Fowler

LESS « The Dynamic Stylesheet language - 8 views

  •  
    The LESS Ruby gem compiles LESS code to CSS.  LESS is an extension of CSS. You can write LESS code just like you would write CSS, except you need to compile it to CSS. That's what the gem is for. If you are on Mac OS X, you can install the gem by typing the following command in the terminal:
  •  
    LESS extends CSS with dynamic behavior such as variables, mixins, operations and functions. LESS runs on both the server-side (with Node.js and Rhino) or client-side (modern browsers only).
Vernon Fowler

Ten Reasons You Should Be Using a CSS Preprocessor | Urban Insight Blog - 0 views

  • 10 reasons you should consider using a CSS preprocessor
  • you can start using things like variables, mixins, and functions. It will allow you to start reusing properties and patterns over and over, after defining them just once
  • nothing is repeated
  • ...2 more annotations...
  • Both Less and Sass support nested definitions.
  • if you can write CSS, you already know how to write valid .less
Vernon Fowler

LESS « The Dynamic Stylesheet language - 0 views

  • It is possible to output rules in your CSS which allow tools to locate the source of the rule. Either specify the option dumpLineNumbers as above or add !dumpLineNumbers:mediaQuery to the url.
Vernon Fowler

Sass Style Guide | CSS-Tricks - 0 views

  • List @extend(s) First
  • List "Regular" Styles Next
  • List @include(s) Next
  • ...9 more annotations...
  • All Vendor Prefixes Use @mixins
  • Global and Section-Specific Sass Files Are just Table of Contents In other words, no styles directly in them. Force yourself to keep all styles organized into component parts.
  • If you find yourself using a number other than 0 or 100% over and over, it likely deserves a variable.
  • List Vendor/Global Dependancies First, Then Author Dependancies, Then Patterns, Then Parts
  • In Deployment, Compile Compressed
  • Comments get stripped when compiling to compressed code, so there is no cost.
  • Partials are named _partial.scss
  • Variablize All Colors Except perhaps white and black.
  • In your global stylesheet, @import a _shame.scss file last.
Vernon Fowler

Compass Home | Compass Documentation - 4 views

  •  
    Compass is a stylesheet authoring framework that makes your stylesheets and markup easier to build and maintain. With compass, you write your stylesheets in Sass instead of CSS. Using the power of Sass Mixins and the Compass community, you can apply battle-tested styles from frameworks like Blueprint to your stylesheets instead of your markup.
Vernon Fowler

A Complete Guide to Flexbox | CSS-Tricks - 0 views

  • flex-direction
  • flex-wrap
  • space-around: items are evenly distributed in the line with equal space around them
  • ...6 more annotations...
  • justify-content
  • align-items
  • flex-start: cross-start margin edge of the items is placed on the cross-start line
  • stretch (default): stretch to fill the container (still respect min-width/max-width)
  • Note: this property has no effect when the flexbox has only a single line.
  • flex-grow
1 - 12 of 12
Showing 20 items per page