Article Introduction: introduction of less and its difference with sass.
Original:
introduction of less and its difference with sass
Translated from:
An Introduction to less, and Comparison to Sass
Original Author:
Jeremy Hixon
Please respect the copyright, reproduced please indicate the source, thank you!
Since I stumbled upon less one months ago
People who have learned CSS know that it is not a kindProgramming Language.
You can use it to develop webpage styles, but it cannot be programmed. That is to say, CSS is basically a designer tool, notProgramTool. In the eyes of programmers, CSS is a very troublesome thing. It has no variables and no conditional statements. It is a simple description of a row, which is quite troublesome to write.
Naturally, someone begins to add programming elements to CSS, called "CSS Preprocessor" (CSS P
">
Main Content
div>
div class="span-4 last">
Right Sidebar
div>
div class="span-24 last">
Footer
div>
div>
body>
html>
Span-x indicates that the content spans X meshes, while the right side has a margin of 10 pixels, such as the span-4 width of 4*40-10=150 pixels. Note that when the content crosses the 24th style, the last style needs to be defined, and the last style is set Right-margin to 0. So the above example is clear, the header and footer acros
Sass BASICS (5)-Mr. Lemon
@ If
@ If is a SassScript that can process style Blocks Based on conditions. if the condition is true, a style block is returned. Otherwise
False returns another style block. In Sass, in addition to @ if, @ else if and eles can also be used together.
For example:
// SCSS
@ Mixin blockOrHidden ($ boolean: true ){
@ If $ boolean {
@ Debug "$ boolean is # {$ boolean }";
Display: block
I. What is SASS/SCSS and less?Sass (syntactically Awesome stylesheets) is a dynamic style language, Sass syntax is the indentation syntax, more than CSS more than a number of functions (such as variables, nesting, operation, mixing (Mixin), inheritance, color processing, functions, etc.), easier to read.What is the relationship between
This article mainly introduces the SASS style programming guide for CSS, including the use of nesting tools and comments. For more and more developers, see SASS, we need to pay attention to the number of SASS codes. We can start with the CSS (stacked style sheet) syntax to explain some of the SASS syntax's special poin
As a member of the graph cutting field, or rolling in the front-end field for a period of time, you will slowly find that the current css writing cannot meet your own efficiency. If you have a more powerful framework that makes your css more flexible and easier to reuse and maintain, that would be nice. Obviously, this is nothing new. sass and less are two excellent style preprocessors, which can greatly improve your efficiency. Next we will talk abou
Please note: You will need to install git before you step into this git installation tutorial.ObjectiveTo date, almost everyone is talking about bootstrap, less or sass. We know that they are newer front-end technologies, and there are trends that are starting to get more popular, but how do you use them?Imagine that we now have a new case to use to bootstrap, but we also want to make some changes, what should we do?Let's pretend you already know what
At the sassconf Conference, we were given the new features of sass3.3. These new features have a lot of significance, especially@at-rootCommand to make your code better clean.
Today, we will take a look@at-rootUsage specification of features.
Learn more@at-rootWe will first recall the sass nesting function. Let's look at an example. The following code is common in our CSS:
.foo { color:green;}.foo .bar { color:gray;}
Return to
I haven't had much contact with Sass before, and then I saw this magical thing seen in the CSS precompiled processor in a front-end knowledge system structure diagram written by Daniel.In fact, although not how to hear it before, but used, you really do not believe, before the NetEase internship in a senior in and I wrote a GitHub pages project, recommended meThe use of MCSs (this is written by the great god NetEase another CSS pre-compiler, of course
">
Main Content
div>
div class="span-4 last">
Right Sidebar
div>
div class="span-24 last">
Footer
div>
div>
body>
html>
Span-x indicates that the content spans X meshes, while the right side has a margin of 10 pixels, such as the span-4 width of 4*40-10=150 pixels. Note that when the content crosses the 24th style, the last style needs to be defined, and the last style is set Right-margin to 0. So the above example is clear, the header and footer acros
I. What is SASS/SCSS and less?Sass (syntactically Awesome stylesheets) is a dynamic style language, Sass syntax is the indentation syntax, more than CSS more than a number of functions (such as variables, nesting, operation, mixing (Mixin), inheritance, color processing, functions, etc.), easier to read.What is the relationship between
Let the font-size of the paragraph keep a certain orbit (track) based on the response breakpoint, from H1 to H6 set a variable for the font size for each breakpoint, which makes things much more cumbersome, especially when the type is not on a linear scale.If you try to solve such a layout in response, the following code looks very familiar:p {font-size:15px;}@media screen and (min-width:480px) {p {font-size:16px;}}@media screen and (min-width:640px) {p {font-size:17px;}}@media screen and (min-w
I. 1. {} Not required in previous sass, sass file suffix ". Sass"2. {} is required in sass now, the sass file suffix is ". Scss"Role: The role of less and sass are used for code simplification and reuse3. Steps to create a
Sass for the CSS to give the characteristics of dynamic language, such as variables, inheritance, operations, functions, etc., more convenient for the writing and maintenance of CSS!
Sass Installation
Because SASS relies on the ruby environment, make sure Ruby is installed before installing SASS. Install Ruby http://
Sass BASICS (8)-Mr. Lemon
@ Import
Sass supports all css @ rules and some Sass exclusive rules, also known as "directive". These rules have different
The function is described as follows.
@ Import
Sass extends the @ import rule of CSS so that it can introduce SCSS and Sass
F
Sass, sassless
Note: For details, refer to the Sass and Compass designer guide.
Sass is a command line tool based on the Ruby programming language. To use Ruby, you must first install Ruby on your computer. for Ruby installation, visit http://rubyinstaller.org/downloads/to download the latest version of ruby. after installation, you can use Ruby-v to verify wheth
This article mainly explains the content of compass, it is well known that compass is a SASS tool library, if the sass do not know the students can be sass and Compass Sass Chapter Sass itself is just a "CSS preprocessor", compass on its basis, Encapsulates a range of module
(2) Use Sass, Compass, and sasscompass in practiceChapter 3 CSS grid layout without computation 3.1 Introduction to grid layout 3.2 use of grid layout 3.2.1 terminology
1. Term name: determines whether HTML tags are involved. 2 columns of content measurement. Vertical unit. No. 3. HTML elements in a grid layout are the columns in a 4-cell grid layout.3.2.3 fixed grid layout or flow grid layout
1 // because the screen sizes of network users are differe
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.