mirror of
https://github.com/jgthms/bulma
synced 2026-03-15 02:04:29 -07:00
Fix travis builds
This commit is contained in:
@@ -1,29 +1,35 @@
|
|||||||
@function mergeColorMaps($bulma-colors, $custom-colors)
|
@function mergeColorMaps($bulma-colors, $custom-colors)
|
||||||
// we return at least bulma hardcoded colors
|
// we return at least bulma hardcoded colors
|
||||||
$merged-colors: $bulma-colors
|
$merged-colors: $bulma-colors
|
||||||
|
|
||||||
// we want a map as input
|
// we want a map as input
|
||||||
@if type-of($custom-colors) == 'map'
|
@if type-of($custom-colors) == 'map'
|
||||||
@each $name, $components in $custom-colors
|
@each $name, $components in $custom-colors
|
||||||
// color name should be a string and colors pair a list with at least one element
|
// color name should be a string and colors pair a list with at least one element
|
||||||
@if type-of($name) == 'string' and (type-of($components) == 'list' or type-of($components) == 'color') and length($components) >= 1
|
@if type-of($name) == 'string' and (type-of($components) == 'list' or type-of($components) == 'color') and length($components) >= 1
|
||||||
$color-base: null
|
$color-base: null
|
||||||
// only a single color is provided
|
|
||||||
|
// the param can either be a single color
|
||||||
|
// or a list of 2 colors
|
||||||
@if type-of($components) == 'color'
|
@if type-of($components) == 'color'
|
||||||
$color-base: $components
|
$color-base: $components
|
||||||
// a list of colors is provided
|
|
||||||
@else if type-of($components) == 'list'
|
@else if type-of($components) == 'list'
|
||||||
$color-base: nth($components, 1)
|
$color-base: nth($components, 1)
|
||||||
|
|
||||||
$color-invert: null
|
$color-invert: null
|
||||||
// is an inverted color provided ?
|
// is an inverted color provided in the list
|
||||||
@if length($components) > 1
|
@if length($components) > 1
|
||||||
$color-invert: nth($components, 2)
|
$color-invert: nth($components, 2)
|
||||||
|
|
||||||
// we only want a color as base color
|
// we only want a color as base color
|
||||||
@if type-of($color-base) == 'color'
|
@if type-of($color-base) == 'color'
|
||||||
// if inverted color is not provided or is not a color we compute it
|
// if inverted color is not provided or is not a color we compute it
|
||||||
@if type-of($color-invert) != 'color'
|
@if type-of($color-invert) != 'color'
|
||||||
$color-invert: findColorInvert($color-base)
|
$color-invert: findColorInvert($color-base)
|
||||||
|
|
||||||
// we merge this colors elements as map with bulma colors (we can override them this way, no multiple definition for the same name)
|
// we merge this colors elements as map with bulma colors (we can override them this way, no multiple definition for the same name)
|
||||||
$merged-colors: map_merge($merged-colors, ($name: ($color-base, $color-invert)))
|
$merged-colors: map_merge($merged-colors, ($name: ($color-base, $color-invert)))
|
||||||
|
|
||||||
@return $merged-colors
|
@return $merged-colors
|
||||||
|
|
||||||
@function powerNumber($number, $exp)
|
@function powerNumber($number, $exp)
|
||||||
|
|||||||
Reference in New Issue
Block a user