silk_icons 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/silk_icons/version.rb +1 -1
- data/lib/tasks/silk_icons.rake +14 -12
- data/vendor/assets/stylesheets/silk_icons.css.scss +1008 -6000
- metadata +5 -5
data/lib/silk_icons/version.rb
CHANGED
data/lib/tasks/silk_icons.rake
CHANGED
@@ -74,20 +74,22 @@ namespace :silk_icons do
|
|
74
74
|
end
|
75
75
|
|
76
76
|
file "#{stylesheet}" => [ :unpack, "#{stylesheets_dir}" ] do |t|
|
77
|
-
content = ''
|
77
|
+
content = <<-PREAMBLE.gsub(/^ /, '')
|
78
|
+
@mixin silk-icon-sprite-at-index($n) {
|
79
|
+
background-image: image-url('silk_icons/sprite.png') !important;
|
80
|
+
background-repeat: no-repeat !important;
|
81
|
+
background-position: ($n % 40) * (-16px) floor($n / 40) * (-16px) !important;
|
82
|
+
width: 16px !important;
|
83
|
+
height: 16px !important;
|
84
|
+
overflow: hidden !important;
|
85
|
+
}
|
86
|
+
PREAMBLE
|
78
87
|
Dir.chdir ENV['SILK_ICONS_TMP'] do
|
79
88
|
pngs = FileList['icons/*.png'].pathmap('%n').sort
|
80
|
-
pngs.
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
background: image-url('silk_icons/sprite.png') no-repeat -#{x*16}px -#{y*16}px;
|
85
|
-
width: 16px;
|
86
|
-
height: 16px;
|
87
|
-
overflow: hidden;
|
88
|
-
}
|
89
|
-
STYLE
|
90
|
-
end
|
89
|
+
pngs.each_with_index do |png, i|
|
90
|
+
content += <<-STYLE.lstrip
|
91
|
+
.silk_icon-#{png} { @include silk-icon-sprite-at-index(#{i}); }
|
92
|
+
STYLE
|
91
93
|
end
|
92
94
|
end
|
93
95
|
|