最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。
@mixin directive allows us to define a style that can be reused throughout the stylesheet.
Mixin through Sass Code: Note: Sass connection symbols-and underscore symbols _ are the same, that is, Sass Therefore, include Example Convert the above code to CSS code, as follows: Css Code: Blending can also include blending, as follows: Example Blending can receive parameters. We can pass variables to the mix. Define the blending that can receive parameters: Example The blending parameter of the above example is the property that sets the border ( Convert the above code to CSS code, as follows: Css Code: You can also define default values for mixed parameters. The syntax format is as follows: Example When including blending, you only need to pass the required variable name and its value: Example Convert the above code to CSS code, as follows: Css Code: Sometimes we are not sure how many arguments are used by a mixin or a function (function), so we can use… to set variable parameters. For example, a mixin used to create a box box-shadow can take any number of``box-shadow`` as a parameter. Example Convert the above code to CSS code, as follows: Css Code: It is also very convenient for browser prefixes to be mixed, as shown in thefollowing example: Convert the above code to CSS code, as follows: @include directive can introduce mixin into the document. 13.6.1. Define a mix ¶
@mixin directive to define. @mixin name { property: value; property: value; ... } , the following example creates a mix named “important-text”:@mixin important-text { color: red; font-size: 25px; font-weight: bold; border: 1px solid blue; }
@mixin important-text { } and @mixin important_text { } It’s the same blend in.Use blending ¶
@include directive can be used to include a mix: @include mix in the syntax:selector { @include mixin-name; }
important-text the mixing code is as follows:.danger { @include important-text; background-color: green; }
.danger { color: red; font-size: 25px; font-weight: bold; border: 1px solid blue; background-color: green; }
@mixin special-text { @include important-text; @include link; @include special-border; }
13.6.2. Pass variables to blending ¶
/\* Mixing in and receiving two parameters \*/ @mixin bordered($color, $width) { border: $width solid $color; } .myArticle { @include bordered(blue, 1px); // Call mixing and pass two parameters } .myNotes { @include bordered(red, 2px); // Call mixing and pass two parameters } color and width )..myArticle { border: 1px solid blue; } .myNotes { border: 2px solid red; }
@mixin bordered($color: blue, $width: 1px) { border: $width solid $color; } @mixin sexy-border($color, $width: 1in) { border: { color: $color; width: $width; style: dashed; } } p { @include sexy-border(blue); } h1 { @include sexy-border(blue, 2in); } p { border-color: blue; border-width: 1in; border-style: dashed; } h1 { border-color: blue; border-width: 2in; border-style: dashed; }
Variable parameter ¶
@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); } .shadows { -moz-box-shadow: 0px 4px 5px #666, 2px 6px 10px #999; -webkit-box-shadow: 0px 4px 5px #666, 2px 6px 10px #999; box-shadow: 0px 4px 5px #666, 2px 6px 10px #999; }
13.6.3. Browser prefixes using blending ¶
Example ¶
@mixin transform($property) { -webkit-transform: $property; -ms-transform: $property; transform: $property; } .myBox { @include transform(rotate(20deg)); } Css Code: ¶
.myBox { -webkit-transform: rotate(20deg); -ms-transform: rotate(20deg); transform: rotate(20deg); }