mirror of
https://github.com/jgthms/bulma
synced 2026-03-21 20:54:30 -07:00
1
docs/.gitignore
vendored
1
docs/.gitignore
vendored
@@ -5,6 +5,7 @@
|
|||||||
_config.local.yml
|
_config.local.yml
|
||||||
_config.version.yml
|
_config.version.yml
|
||||||
_layouts/basic.html
|
_layouts/basic.html
|
||||||
|
_layouts/dev.html
|
||||||
bulma-test.sass
|
bulma-test.sass
|
||||||
bulma-test.scss
|
bulma-test.scss
|
||||||
bulma-test.css
|
bulma-test.css
|
||||||
|
|||||||
@@ -1,34 +1,39 @@
|
|||||||
@function mergeColorMaps($bulma-colors, $custom-colors)
|
@function mergeColorMaps($bulma-colors, $custom-colors)
|
||||||
// we return at least bulma hardcoded colors
|
// We return at least Bulma's hard-coded 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
|
// The color name should be a string
|
||||||
|
// and the components either a single color
|
||||||
|
// or a colors 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
|
||||||
|
$value: null
|
||||||
|
|
||||||
// the param can either be a single color
|
// The param can either be a single color
|
||||||
// or a list of 2 colors
|
// or a list of 2 colors
|
||||||
@if type-of($components) == 'color'
|
@if type-of($components) == 'color'
|
||||||
$color-base: $components
|
$color-base: $components
|
||||||
|
$value: $components
|
||||||
@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
|
// Check if the invert color is provided,
|
||||||
// is an inverted color provided in the list
|
// otherwise compute it
|
||||||
@if length($components) > 1
|
@if length($components) > 1
|
||||||
$color-invert: nth($components, 2)
|
$color-invert: nth($components, 2)
|
||||||
|
@else
|
||||||
// we only want a color as base color
|
|
||||||
@if type-of($color-base) == 'color'
|
|
||||||
// if inverted color is not provided or is not a color we compute it
|
|
||||||
@if type-of($color-invert) != 'color'
|
|
||||||
$color-invert: findColorInvert($color-base)
|
$color-invert: findColorInvert($color-base)
|
||||||
|
$value: ($color-base, $color-invert)
|
||||||
|
|
||||||
// we merge this colors elements as map with bulma colors (we can override them this way, no multiple definition for the same name)
|
// We only want to merge the map if the color base is an actual color
|
||||||
$merged-colors: map_merge($merged-colors, ($name: ($color-base, $color-invert)))
|
@if type-of($color-base) == 'color'
|
||||||
|
// We merge this colors elements as map with Bulma's colors map
|
||||||
|
// (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: $value))
|
||||||
|
|
||||||
@return $merged-colors
|
@return $merged-colors
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user