Compare commits

...
Sign in to create a new pull request.

8 commits

Author SHA1 Message Date
XhmikosR
b6c3771dcc
Merge branch 'main' into new-border-bg-utils 2020-12-12 10:43:41 +02:00
XhmikosR
167b44e425
Merge branch 'main' into new-border-bg-utils 2020-11-17 15:43:43 +02:00
XhmikosR
46fb1b6ddc
Merge branch 'main' into new-border-bg-utils 2020-11-14 17:13:19 +02:00
XhmikosR
37640d0294
Merge branch 'main' into new-border-bg-utils 2020-11-13 19:02:07 +02:00
XhmikosR
e3336b143e
Merge branch 'main' into new-border-bg-utils 2020-11-06 15:10:19 +02:00
XhmikosR
b1f28e3b3d
Merge branch 'main' into new-border-bg-utils 2020-11-01 15:10:18 +02:00
XhmikosR
23363ad891
Merge branch 'main' into new-border-bg-utils 2020-09-30 16:33:24 +03:00
Mark Otto
5af9aa58c0 Add new border-color and background-color utilities
- bg-gray is new and maps to gray-400
- border-gray-500 and border-gray-700 are new and are meant to complement bg-gray and bg-secondary as one level off from the borders
2020-09-17 15:08:13 -07:00
3 changed files with 26 additions and 2 deletions

View file

@ -110,7 +110,15 @@ $utilities: map-merge(
"border-color": (
property: border-color,
class: border,
values: map-merge($theme-colors, ("white": $white))
values: map-merge(
$theme-colors,
(
"white": $white,
"gray-500": $gray-500,
"gray-700": $gray-700,
"black": $black
)
)
),
"border-width": (
property: border-width,
@ -473,6 +481,8 @@ $utilities: map-merge(
(
"body": $body-bg,
"white": $white,
"gray": $gray-400,
"black": black,
"transparent": transparent
)
)

View file

@ -32,7 +32,7 @@ Use border utilities to add or remove an element's borders. Choose from all bord
## Border color
Change the border color using utilities built on our theme colors.
Change the border color using utilities built on our theme colors. We've also included a subset of our gray colors to provide more flexibility.
{{< example class="bd-example-border-utils" >}}
{{< border.inline >}}
@ -41,6 +41,18 @@ Change the border color using utilities built on our theme colors.
{{- end -}}
{{< /border.inline >}}
<span class="border border-white"></span>
<span class="border border-gray-500"></span>
<span class="border border-gray-700"></span>
<span class="border border-black"></span>
{{< /example >}}
The gray `border-color` utilities differ slightly than our `background-color` utilities so that there's some slight contrast between the two.
{{< example >}}
<div class="p-3 mb-1 bg-light border"></div>
<div class="p-3 mb-1 bg-gray border border-gray-500"></div>
<div class="p-3 mb-1 bg-secondary border border-gray-700"></div>
<div class="p-3 mb-1 bg-dark border border-black"></div>
{{< /example >}}
## Border-width

View file

@ -43,7 +43,9 @@ Similar to the contextual text color classes, easily set the background of an el
<div class="p-3 mb-2 bg-{{ .name }}{{ if .contrast_color }} text-{{ .contrast_color }}{{ else }} text-white{{ end }}">.bg-{{ .name }}</div>
{{- end -}}
{{< /colors.inline >}}
<div class="p-3 mb-2 bg-gray text-dark">.bg-gray</div>
<div class="p-3 mb-2 bg-white text-dark">.bg-white</div>
<div class="p-3 mb-2 bg-black text-white">.bg-black</div>
<div class="p-3 mb-2 bg-transparent text-dark">.bg-transparent</div>
{{< /example >}}