Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
c31d5249
Commit
c31d5249
authored
7 years ago
by
Mark Otto
Browse files
Options
Download
Email Patches
Plain Diff
add color contrast and map-get functions
parent
516af795
7 merge requests
!28721
Hot test
,
!27561
Adds font-weight-medium to font weight classes
,
!25326
Adjust examples
,
!23995
Add back cursor: pointer for .btn-link
,
!23178
Spinner
,
!22836
v4: Colors redux
,
!17021
v4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scss/_functions.scss
+23
-0
scss/_functions.scss
with
23 additions
and
0 deletions
+23
-0
scss/_functions.scss
+
23
-
0
View file @
c31d5249
...
...
@@ -47,3 +47,26 @@
@return
$string
;
}
// Color contrast
@mixin
color-yiq
(
$color
)
{
$r
:
red
(
$color
);
$g
:
green
(
$color
);
$b
:
blue
(
$color
);
$yiq
:
((
$r
*
299
)
+
(
$g
*
587
)
+
(
$b
*
114
))
/
1000
;
@if
(
$yiq
>=
128
)
{
color
:
#111
;
}
@else
{
color
:
#fff
;
}
}
// Retreive color Sass maps
@function
color
(
$key
:
"blue"
)
{
@return
map-get
(
$colors
,
$key
);
}
@function
theme-color
(
$key
:
"primary"
)
{
@return
map-get
(
$theme-colors
,
$key
);
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets