Last active
September 12, 2018 08:02
-
-
Save adyz/9774898 to your computer and use it in GitHub Desktop.
Revisions
-
adyz revised this gist
Mar 26, 2014 . 1 changed file with 11 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,13 @@ // 1: To export the PNGs in different sizes I used Slicy - http://macrabbit.com/slicy/ - a mac app that looks into your PSD and if it finds any layer with .png extention will export that layer to PNG. You can also add a tag to the main group layer to export retina version too. A bit pricy, but it's fine if you value your time. // 2: I added the icons in two folders (retina and normal) You just have to make sure that both folders contain the same number of files and they both have the same file name inside. // 3: I added this code after long time of searchin, testing, and mashing my head into the wall. $naviconsNormal: sprite-map("navicons/normal/*.png", $spacing: 10px); $naviconsRetina: sprite-map("navicons/retina/*.png", $spacing: 20px); .icn{ @@ -36,18 +36,16 @@ $naviconsNormal: sprite-map("navicons/normal/*.png", $spacing: 10px); } } //The @include bp-retina it's a mixin for retina screens media query. //Huge thanks to: //Rasmus Thulstrup //https://gist.github.com/thulstrup/2140082 //and //Alan Hogan //https://gist.github.com/alanhogan/2878758 -
adyz renamed this gist
Mar 26, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
adyz revised this gist
Mar 26, 2014 . 1 changed file with 23 additions and 18 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,28 +7,33 @@ **3:** I added this code after long time of searchin, testing, and mashing my head into the wall. $naviconsNormal: sprite-map("navicons/normal/*.png", $spacing: 10px); $naviconsRetina: sprite-map("navicons/retina/*.png", $spacing: 20px); .icn{ background: $naviconsNormal; display: inline-block; // or block @include bp-retina { background: $naviconsRetina; //Instead of sprite-path might be sprite-url @include background-size(image-width(sprite-path($naviconsNormal)) image-height(sprite-path($naviconsNormal))); } } @each $i in sprite_names($naviconsNormal){ .icn-#{$i}{ background-position: sprite-position($naviconsNormal, $i); @include sprite-dimensions($naviconsNormal, $i); } } @include bp-retina { @each $i in sprite_names($naviconsNormal){ .icn-#{$i}{ $ypos: round(nth(sprite-position($naviconsRetina, $i), 2) / 2); background-position: 0 $ypos; } } } **All this code performs really slow on multiple icons, but I refuse to do-it otherwhise.** -
adyz revised this gist
Mar 26, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,6 +15,8 @@ display: inline-block; // or block @include bp-retina { background: $naviconsRetina; //Instead of sprite-path might be sprite-url @include background-size(image-width(sprite-path($naviconsNormal)) image- height(sprite-path($naviconsNormal))); } } @@ -25,8 +27,6 @@ @include bp-retina { $ypos: round(nth(sprite-position($naviconsRetina, $i), 2) / 2); background-position: 0 $ypos; } } } -
adyz revised this gist
Mar 26, 2014 . 1 changed file with 26 additions and 25 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,39 +6,40 @@ **3:** I added this code after long time of searchin, testing, and mashing my head into the wall. $naviconsNormal: sprite-map("navicons/normal/*.png", $spacing: 10px); $naviconsRetina: sprite-map("navicons/retina/*.png", $spacing: 20px); .icn{ background: $naviconsNormal; display: inline-block; // or block @include bp-retina { background: $naviconsRetina; } } @each $i in sprite_names($naviconsNormal){ .icn-#{$i}{ background-position: sprite-position($naviconsNormal, $i); @include sprite-dimensions($naviconsNormal, $i); @include bp-retina { $ypos: round(nth(sprite-position($naviconsRetina, $i), 2) / 2); background-position: 0 $ypos; //Instead of sprite-path might be sprite-url @include background-size(image-width(sprite-path($naviconsNormal)) image- height(sprite-path($naviconsNormal))); } } } **All this code performs really slow on multiple icons, but I refuse to do-it otherwhise.** * The @include bp-retina it's a mixin for retina screens media query. * **Huge thanks to:** Rasmus Thulstrup https://gist.github.com/thulstrup/2140082 and Alan Hogan -
adyz revised this gist
Mar 26, 2014 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,10 @@ **1:** To export the PNGs in different sizes I used Slicy - http://macrabbit.com/slicy/ - a mac app that looks into your PSD and if it finds any layer with .png extention will export that layer to PNG. You can also add a tag to the main group layer to export retina version too. A bit pricy, but it's fine if you value your time. **2:** I added the icons in two folders (retina and normal) You just have to make sure that both folders contain the same number of files and they both have the same file name inside. **3:** I added this code after long time of searchin, testing, and mashing my head into the wall. ` $naviconsNormal: sprite-map("navicons/normal/*.png", $spacing: 10px); @@ -33,9 +33,9 @@ $naviconsRetina: sprite-map("navicons/retina/*.png", $spacing: 20px); } ` **All this code performs really slow on multiple icons, but I refuse to do-it otherwhise.** **Huge thanks to:** Rasmus Thulstrup https://gist.github.com/thulstrup/2140082 -
adyz renamed this gist
Mar 26, 2014 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,12 @@ ##1: To export the PNGs in different sizes I used Slicy - http://macrabbit.com/slicy/ - a mac app that looks into your PSD and if it finds any layer with .png extention will export that layer to PNG. You can also add a tag to the main group layer to export retina version too. A bit pricy, but it's fine if you value your time. ##2: I added the icons in two folders (retina and normal) You just have to make sure that both folders contain the same number of files and they both have the same file name inside. ##3: I added this code after long time of searchin, testing, and mashing my head into the wall. ` $naviconsNormal: sprite-map("navicons/normal/*.png", $spacing: 10px); $naviconsRetina: sprite-map("navicons/retina/*.png", $spacing: 20px); @@ -31,11 +31,11 @@ $naviconsRetina: sprite-map("navicons/retina/*.png", $spacing: 20px); } } } ` All this code performs really slow on multiple icons, but I refuse to do-it otherwhise. ##Huge thanks to: Rasmus Thulstrup https://gist.github.com/thulstrup/2140082 -
adyz revised this gist
Mar 26, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ #1: To export the PNGs in different sizes I used Slicy - http://macrabbit.com/slicy/ - a mac app that looks into your PSD and if it finds any layer with .png extention will export that layer to PNG. You can also add a tag to the main group layer to export retina version too. A bit pricy, but it's fine if you value your time. 2: I added the icons in two folders (retina and normal) You just have to make sure that both folders contain the same number of files and they both have the same file name inside. -
adyz revised this gist
Mar 26, 2014 . No changes.There are no files selected for viewing
-
adyz created this gist
Mar 26, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ 1: To export the PNGs in different sizes I used Slicy - http://macrabbit.com/slicy/ - a mac app that looks into your PSD and if it finds any layer with .png extention will export that layer to PNG. You can also add a tag to the main group layer to export retina version too. A bit pricy, but it's fine if you value your time. 2: I added the icons in two folders (retina and normal) You just have to make sure that both folders contain the same number of files and they both have the same file name inside. 3: I added this code after long time of searchin, testing, and mashing my head into the wall. $naviconsNormal: sprite-map("navicons/normal/*.png", $spacing: 10px); $naviconsRetina: sprite-map("navicons/retina/*.png", $spacing: 20px); .icn{ background: $naviconsNormal; display: inline-block; // or block @include bp-retina { background: $naviconsRetina; } } @each $i in sprite_names($naviconsNormal){ .icn-#{$i}{ background-position: sprite-position($naviconsNormal, $i); @include sprite-dimensions($naviconsNormal, $i); @include bp-retina { $ypos: round(nth(sprite-position($naviconsRetina, $i), 2) / 2); background-position: 0 $ypos; //Instead of sprite-path might be sprite-url @include background-size(image-width(sprite-path($naviconsNormal)) image-height(sprite-path($naviconsNormal))); } } } All this code performs really slow on multiple icons, but I refuse to do-it otherwhise. Huge thanks to: Rasmus Thulstrup https://gist.github.com/thulstrup/2140082 and Alan Hogan https://gist.github.com/alanhogan/2878758