-
Notifications
You must be signed in to change notification settings - Fork 1
/
sass.template.mustache
executable file
·79 lines (66 loc) · 2.4 KB
/
sass.template.mustache
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{
// Default options
'functions': true
}
/*
SASS variables are information about icon's compiled state, stored under its original file name
.icon-home
width: $icon-home-width
The large array-like variables contain all information about a single icon
$icon-home: x y offset_x offset_y width height total_width total_height image_path
At the bottom of this section, we provide information about the spritesheet itself
$spritesheet: width height image $spritesheet-sprites
*/
{{#items}}
${{name}}-name: '{{name}}'
${{name}}-x: {{px.x}}
${{name}}-y: {{px.y}}
${{name}}-offset-x: {{px.offset_x}}
${{name}}-offset-y: {{px.offset_y}}
${{name}}-width: {{px.width}}
${{name}}-height: {{px.height}}
${{name}}-total-width: {{px.total_width}}
${{name}}-total-height: {{px.total_height}}
${{name}}-image: '{{{escaped_image}}}'
${{name}}: {{px.x}} {{px.y}} {{px.offset_x}} {{px.offset_y}} {{px.width}} {{px.height}} {{px.total_width}} {{px.total_height}} '{{{escaped_image}}}' '{{name}}'
{{/items}}
${{spritesheet_name}}-width: {{spritesheet.px.width}}
${{spritesheet_name}}-height: {{spritesheet.px.height}}
${{spritesheet_name}}-image: '{{{spritesheet.escaped_image}}}'
${{spritesheet_name}}-sprites:{{#items}} ${{name}}{{/items}}
${{spritesheet_name}}: {{spritesheet.px.width}} {{spritesheet.px.height}} '{{{spritesheet.escaped_image}}}' ${{spritesheet_name}}-sprites
{{#options.functions}}
/*
The provided mixins are intended to be used with the array-like variables
.icon-home
@include sprite-width($icon-home)
.icon-email
@include sprite($icon-email)
*/
@mixin sprite-width($sprite)
width: nth($sprite, 5)
@mixin sprite-height($sprite)
height: nth($sprite, 6)
@mixin sprite-position($sprite)
$sprite-offset-x: nth($sprite, 3)
$sprite-offset-y: nth($sprite, 4)
background-position: $sprite-offset-x $sprite-offset-y
@mixin sprite-image($sprite)
$sprite-image: nth($sprite, 9)
background-image: url(../img/#{$sprite-image})
@mixin sprite($sprite)
@include sprite-image($sprite)
@include sprite-position($sprite)
@include sprite-width($sprite)
@include sprite-height($sprite)
/*
The `sprites` mixin generates identical output to the CSS template
but can be overridden inside of SASS
@include sprites($spritesheet-sprites)
*/
@mixin sprites($sprites)
@each $sprite in $sprites
$sprite-name: nth($sprite, 10)
.#{$sprite-name}
@include sprite($sprite)
{{/options.functions}}