123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- /**
- * @class Global_CSS
- */
- @import 'icon.js';
- /**
- * Generates style rules for an icon element
- *
- * @param {list/string} $icon
- * A unicode character to use as the icon, or a list specifying the character to use
- * followed by font-family and degrees of rotation (90, 180, or 270).
- * All parameters in the list are optional except for glyph. For example, each of the
- * following is valid:
- *
- * Use the letter "A" as the icon and use the default font-family
- *
- * @include font-icon('\0041');
- *
- * Use the letter "A" as the icon and use FontAwesome as the font-family
- *
- * @include font-icon('\0041' FontAwesome);
- *
- * Use the letter "A" as the icon and rotate the icon 90 degrees clockwise.
- *
- * @include font-icon('\0041' 90);
- *
- * Use the letter "A" as the icon, use FontAwesome as the font-family, and rotate the icon
- * 90 degrees clockwise.
- *
- * @include font-icon('\0041' FontAwesome 90);
- *
- * @param {color} $color
- * The color to apply to the element which is containing the icon. See $pseudo-color below
- *
- * @param {number} $size
- * The size of the icon element
- *
- * @param {number} $size-big
- * The size of the icon element in the {@link Global_CSS#$enable-big big} sizing scheme
- *
- * @param {number} $font-size
- * The font-size of the icon. Applied to the :before pseudo element so that it does not affect
- * `$size` when `$size` is specified in `em` units.
- *
- * @param {number} $font-size-big
- * The font-size of the icon in the {@link Global_CSS#$enable-big big} sizing scheme.
- * Applied to the :before pseudo element so that it does not affect `$size-big` when
- * `$size-big` is specified in `em` units.
- *
- * @param {booleab} $style-pseudo
- * Specify as `true` to apply the `$color` and `$size` parameters to the pseudo element
- * which carries the icon rather than to its encapsulating element.
- *
- * @private
- */
- @mixin icon(
- $icon: null,
- $color: null,
- $size: null,
- $size-big: null,
- $font-size: null,
- $font-size-big: null,
- $style-pseudo: false
- ) {
- $args: parseIconArgs($icon);
- $char: nth($args, 1);
- $font-family: nth($args, 2);
- $rotation: nth($args, 3);
- @if $font-size == null {
- $font-size: $size;
- }
- @if $font-size-big == null {
- $font-size-big: $size-big;
- }
- @if not $style-pseudo {
- color: $color;
- width: $size;
- height: $size;
- @if $enable-big {
- .#{$prefix}big & {
- width: $size-big;
- height: $size-big;
- }
- }
- }
- &:before {
- @if $style-pseudo {
- color: $color;
- width: $size;
- height: $size;
- @if $enable-big {
- .#{$prefix}big & {
- width: $size-big;
- height: $size-big;
- }
- }
- }
- content: $char;
- font-family: $font-family;
- font-size: $font-size;
- @if $rotation != null {
- $rotation-origin: 50% 50%;
- $angle: rotate(#{$rotation}deg);
- display: inline-block;
- -webkit-transform: $angle;
- -webkit-transform-origin: $rotation-origin;
- transform: $angle;
- transform-origin: $rotation-origin;
- }
- @if $enable-big {
- .#{$prefix}big & {
- font-size: $font-size-big;
- }
- }
- }
- }
|