Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
Release 0.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalduez committed May 23, 2014
1 parent eae2b7b commit fd38a9f
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 34 deletions.
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
trim_trailing_white_space_on_save = false
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
node_modules
**/.*
.sass-cache
.bundle
.grunt
node_modules
Gemfile.lock
ruby
8 changes: 2 additions & 6 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
**/.*
.sass-cache
.bundle
node_modules
test
ruby
Gemfile
Gemfile.lock
sache.json
Gruntfile.js
Gemfile.lock
ruby
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SassyIcons changelog

## 0.0.8 <span style="font-size: .8em">(2014-05-23)</span>

### Features

* Added new configuration items `format` and `legacy`.
Empty file added CONTRIBUTING.md
Empty file.
23 changes: 22 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,22 @@ module.exports = function(grunt) {
],
dest: "<%= conf.dist %>/_<%= pkg.title %>.scss",
},
}
},

bump: {
options: {
files: ['package.json'],
updateConfigs: ['pkg'],
commit: true,
commitMessage: 'Release %VERSION%',
commitFiles: ['-a'], // '-a' for all files
createTag: true,
tagName: '%VERSION%',
tagMessage: 'Version %VERSION%',
push: false,
pushTo: 'master'
}
},

});

Expand All @@ -167,6 +182,12 @@ module.exports = function(grunt) {
"shell:compass:dist"
]);

grunt.registerTask("release", [
"bump-only",
"dist",
"bump-commit"
]);

grunt.registerTask("icons_refresh", [
"clean:icons",
"svgmin:icons",
Expand Down
91 changes: 67 additions & 24 deletions dist/_SassyIcons.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SassyIcons – v0.0.7 – 2014-05-23
// SassyIcons – v0.0.8 – 2014-05-23
// https://github.com/pascalduez/SassyIcons
// License: MIT

Expand All @@ -10,13 +10,34 @@

// Default settings.
$icons-defaults: (
spacing : 30px,
dir : "icons",
dir-png : "png",
dir-hidpi : "png_2x",
hidpi-scale : 2,
hidpi-ratio : 1.3,
single-embed: true

// Space around sprites in generated sprite map.
spacing: 30px,

// Main icons directory. sprite-map-create() allows to use sub dirs.
dir: "icons",

// Name of the png sub-folders.
dir-png: "png",

// Name of the hidpi png sub-folders.
dir-hidpi: "png_2x",

// Scale of the hidpi pngs.
hidpi-scale: 2,

// Minimum resolution ratio used in the hidpi media query.
hidpi-ratio: 1.3,

// Whether to embed icons as data URI in the icon-single() mixin.
single-embed: true,

// Default file format unless overridden by parameter, svg | png.
format: "svg",

// Whether to support legacy browsers, svg fallback.
legacy: true

);

// User settings.
Expand Down Expand Up @@ -164,16 +185,22 @@ $icons-maps: ();
//
// Main icon mixin.
//
@mixin icon($name, $sprite, $offset: 0 0, $type: "svg") {

@mixin icon(
$name,
$sprite,
$offset: 0 0,
$format: conf(format)
) {
$map-1x: _sprite-map-get($name);
$map-2x: _sprite-map-get($name, 2x);

// Shorter mixin calls.
$offset-x: nth($offset, 1);
$offset-y: nth($offset, 2);

@if ($type == "svg") {
$legacy-support: conf(legacy);

@if $format == "svg" {

$svg-file: _join((conf(dir), $name, "#{$sprite}.svg"), "/");

Expand All @@ -186,16 +213,18 @@ $icons-maps: ();
@content;
}

.no-svg &,
.no-js & {
@if $legacy-support {
.no-svg &,
.no-js & {

@extend %sprite-map-#{$name}-image-map;
@extend %sprite-map-#{$name}-image-map;

background-position: _sprite-position($map-1x, $sprite, $offset-x, $offset-y);
background-position: _sprite-position($map-1x, $sprite, $offset-x, $offset-y);
}
}

}
@else if ($type == "png") {
@else if $format == "png" {

@extend %sprite-map-#{$name}-image-map;

Expand All @@ -217,7 +246,11 @@ $icons-maps: ();
// Embed a single icon as inline-image (no sprite).
// Should be used sporadically.
//
@mixin icon-single($name, $sprite, $type: "svg") {
@mixin icon-single(
$name,
$sprite,
$format: conf(format)
) {

// sprite-file() and inline-image() no work.
// @see https://github.com/chriseppstein/compass/issues/951
Expand All @@ -232,7 +265,9 @@ $icons-maps: ();
$png-url-1x: call($function, $png-file-1x);
$png-url-2x: call($function, $png-file-2x);

@if ($type == "svg") {
$legacy-support: conf(legacy);

@if $format == "svg" {

background: {
image: $svg-url;
Expand All @@ -243,13 +278,15 @@ $icons-maps: ();
@content;
}

.no-svg &,
.no-js & {
background-image: $png-url-1x;
@if $legacy-support {
.no-svg &,
.no-js & {
background-image: $png-url-1x;
}
}

}
@else if ($type == "png") {
@else if $format == "png" {

background: {
image: $png-url-1x;
Expand Down Expand Up @@ -296,7 +333,13 @@ $icons-maps: ();
// Default to :before
// Allows for easier positioning or centering.
//
@mixin icon-generated($name, $sprite, $type: "svg", $pos: "before", $centered: false) {
@mixin icon-generated(
$name,
$sprite,
$pos: "before",
$centered: false,
$format: conf(format)
) {
position: relative;

&:#{$pos} {
Expand All @@ -314,7 +357,7 @@ $icons-maps: ();
left: calc(50% - #{$width} / 2);
}

@include icon($name: $name, $sprite: $sprite, $type: $type);
@include icon($name: $name, $sprite: $sprite, $format: $format);

@content;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sassyicons",
"title": "SassyIcons",
"version": "0.0.7",
"version": "0.0.8",
"keywords": [
"sass",
"scss",
Expand Down

0 comments on commit fd38a9f

Please sign in to comment.