Skip to content

Commit

Permalink
[improved] adjust icon variables for user customizing
Browse files Browse the repository at this point in the history
  • Loading branch information
minwe committed Jun 20, 2016
1 parent daafb0c commit 0ed43e7
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 12 deletions.
24 changes: 24 additions & 0 deletions src/scss/_user.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// User custom variables
// =============================================================================

// Custom font icon
// -----------------------------------------------------------------------------
//$icon-fonts: (
// // font-family
// YourFont: (
// weight: normal,
// style: normal,
// // font path
// src: unquote(
// 'url("yourfont.woff") format("woff"),
// url("yourfont.ttf") format("truetype"),
// url("yourfont.svg#svgFontName") format("svg");'
// )
// ),
//);
//
//// icon name-unicode map
//$icons: (
// back: \e80a,
// bars: \e80e,
//);
20 changes: 17 additions & 3 deletions src/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,24 @@ $group-header-color: #6d6d72 !default;
$group-header-font-size: $font-size-sm !default;


// Icon Variables
// Icon Variables
// -----------------------------------------------------------------------------
$icon-prefix: #{$namespace}icon;
$icon-path: 'fonts/';
// font list: (font-family, font-weight, font-style, src)
$icon-prefix: #{$namespace}icon !default;
$ratchicons-path: 'fonts/';
$icon-fonts: (
Ratchicons: (
weight: normal,
style: normal,
src: unquote(
'url("#{$ratchicons-path}ratchicons.woff") format("woff"),
url("#{$ratchicons-path}ratchicons.ttf") format("truetype"),
url("#{$ratchicons-path}ratchicons.svg#svgFontName") format("svg");'
)
),
) !default;
// $icon-font-family: Ratchicons, sans-serif !default;
$icon-font-size: 24px !default;
$icons: (
back: \e80a,
bars: \e80e,
Expand Down
3 changes: 3 additions & 0 deletions src/scss/amazeui.touch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
// Variables
@import "variables";

// User Custom variables
@import "user";

// Mixins
@import "helper/mixins";

Expand Down
23 changes: 14 additions & 9 deletions src/scss/components/_icon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,24 @@

// Output
// -----------------------------------------------------------------------------
@font-face {
font-family: Ratchicons;
font-weight: normal;
font-style: normal;
src: url('#{$icon-path}ratchicons.woff') format('woff'),
url('#{$icon-path}ratchicons.ttf') format('truetype'),
url('#{$icon-path}ratchicons.svg#svgFontName') format('svg');
@each $family, $map in $icon-fonts {
@font-face {
font-family: $family;
font-weight: map_get($map, weight);
font-style: map_get($map, style);
src: map_get($map, src);
}
}

%font-icon {
$font-family: '';
@each $family, $map in $icon-fonts {
$font-family: unquote('#{$font-family}#{$family}, ');
}

display: inline-block;
font-family: Ratchicons, sans-serif;
font-size: 24px;
font-family: unquote('#{$font-family}sans-serif');
font-size: $icon-font-size;
line-height: 1;
text-decoration: none;
-webkit-font-smoothing: antialiased;
Expand Down

0 comments on commit 0ed43e7

Please sign in to comment.