123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- /**
- * @class Global_CSS
- */
- /**
- * Creates a border on an element.
- * If any of the parameters is specified as a list, or if any parameter is null,
- * border-style, border-width, and border-color will be specified as separate properties,
- * otherwise all will be collapsed into a single "border" property.
- *
- * @param {number/list} $width
- * The border-width
- *
- * @param {string/list} $style
- * The border-style
- *
- * @param {color/list} $color
- * The border-color
- *
- * @private
- */
- @mixin border(
- $width: null,
- $style: null,
- $color: null
- ) {
- @if $width != null and $style != null and $color != null and
- length($width) == 1 and length($style) == 1 and length($color) == 1 {
- border: $width $style $color;
- } @else {
- @if length($width) > 1 and boxContainsNull($width) {
- border-top-width: top($width);
- border-right-width: right($width);
- border-bottom-width: bottom($width);
- border-left-width: left($width);
- } @else {
- border-width: $width;
- }
- @if length($style) > 1 and boxContainsNull($style) {
- border-top-style: top($style);
- border-right-style: right($style);
- border-bottom-style: bottom($style);
- border-left-style: left($style);
- } @else {
- border-style: $style;
- }
- @if length($color) > 1 and boxContainsNull($color) {
- border-top-color: top($color);
- border-right-color: right($color);
- border-bottom-color: bottom($color);
- border-left-color: left($color);
- } @else {
- border-color: $color;
- }
- }
- }
- /**
- * Creates a top border. If all arguments are non-null they will be collapsed into a single
- * border property.
- *
- * @param {number/list} $width
- * The border-width
- *
- * @param {string/list} $style
- * The border-style
- *
- * @param {color/list} $color
- * The border-color
- *
- * @private
- */
- @mixin border-top(
- $width: null,
- $style: null,
- $color: null
- ) {
- @include border-side(top, $width, $style, $color);
- }
- /**
- * Creates a right border. If all arguments are non-null they will be collapsed into a single
- * border property.
- *
- * @param {number/list} $width
- * The border-width
- *
- * @param {string/list} $style
- * The border-style
- *
- * @param {color/list} $color
- * The border-color
- *
- * @private
- */
- @mixin border-right(
- $width: null,
- $style: null,
- $color: null
- ) {
- @include border-side(right, $width, $style, $color);
- }
- /**
- * Creates a bottom border. If all arguments are non-null they will be collapsed into a single
- * border property.
- *
- * @param {number/list} $width
- * The border-width
- *
- * @param {string/list} $style
- * The border-style
- *
- * @param {color/list} $color
- * The border-color
- *
- * @private
- */
- @mixin border-bottom(
- $width: null,
- $style: null,
- $color: null
- ) {
- @include border-side(bottom, $width, $style, $color);
- }
- /**
- * Creates a left border. If all arguments are non-null they will be collapsed into a single
- * border property.
- *
- * @param {number/list} $width
- * The border-width
- *
- * @param {string/list} $style
- * The border-style
- *
- * @param {color/list} $color
- * The border-color
- *
- * @private
- */
- @mixin border-left(
- $width: null,
- $style: null,
- $color: null
- ) {
- @include border-side(left, $width, $style, $color);
- }
- /**
- * Convenience mixin for border-top, border-right, border-bottom, and border-left
- * @private
- */
- @mixin border-side(
- $side,
- $width: null,
- $style: null,
- $color: null
- ) {
- @if $width != null and $style != null and $color != null {
- border-#{$side}: $width $style $color;
- } @else {
- border-#{$side}-width: $width;
- border-#{$side}-style: $style;
- border-#{$side}-color: $color;
- }
- }
|