SCSS Adjustment Notebook

Source: Internet
Author: User

/* Common */$family: unquote ("Droid+sans"), @import url ("http://fonts.googleapis.com/css?family=#{$family}"); $family: Unquote ("droid+sans+2"); @import url ("http://fonts.googleapis.com/css?family=#{$family}");/*mixin here is like a component,   Give a param the component to style */@mixin firefox-message ($selector) {Body.firefox #{$selector}:before {content: "Hi, Firefox users!";  }} @include Firefox-message (". Header");/* Set Variable */p {$font-size:12px in P;  $line-height:30px; Font: #{$font-size}/#{$line-height};} /* Expression */p:before {content: "I ate #{5 + ten} pies!";} /* This can have a package */.example {color:red;} #main {@import "example";}  /* Do not deliberately write media outside, media will go outside */.sidebar {width:300px;  @media screen and (Orientation:landscape) {width:500px;  }}/*extend like a */.error {border:1px #f00; Background-color: #fdd;}.  Seriouserror {@extend. Error; border-width:3px;} /* This does not understand */.hoverlink {@extend a:hover;}. Comment A.user:hover {font-weight:bold;}  /* @if, @else if */$type: monster;p {@if $type = = Ocean {color:blue; } @else If $type = = Matador {color:red;  } @else If $type = = Monster {color:green;  } @else {color:black; }}/* @for */@for $i from 1 through 3 {. item-#{$i} {width:2em * $i;}} /* @each */@each $animal in Puma, Sea-slug, Egret, salamander {. #{$animal}-icon {background-image:url ('/images/#{$ani  Mal}.png ');  }}/* @while */$i: 6; @while $i > 0 {. item-#{$i} {width:2em * $i;} $i: $i-2;}    /* @mixin pass param, defaut value is 1px*/@mixin sexy-border ($color, $width: 1px) {border: {color: $color;    Width: $width;  style:dashed; }}p {@include Sexy-border (blue, 2px);} /* ecma*/@mixin Box-shadow ($shadows ...)  {-moz-box-shadow: $shadows;  -webkit-box-shadow: $shadows; Box-shadow: $shadows;}. Shadows {@include Box-shadow (0px 4px 5px #666, 2px 6px 10px #999);}  /*2nd example*/@mixin Colors ($text, $background, $border) {color: $text;  Background-color: $background; Border-color: $border;} $values: #ff0000, #00ff00, #0000ff;. Primary {@include colors ($values ...);}/*function & return */$grid-width:40px; $gutter-width:10px; @function grid-width ($n) {@return $n * $grid-width + ($ n-1) * $gutter-width;} #sidebar {width:grid-width (5);}

  

SCSS Adjustment Notebook

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.