Skip to content

Commit 74bc7d4

Browse files
committed
Additional .theme-* utilities to replace color background helpers and more (#41978)
* New .theme-* utilities for consuming the existing .theme styles, replace color-background helpers * Update blue to be less indigo * Rebuild metadata * mdx lint * Fix docs link while here * Fix up some docs work while here * links
1 parent 9b42d6d commit 74bc7d4

File tree

32 files changed

+272
-140
lines changed

32 files changed

+272
-140
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Several quick start options are available:
5252
- Install with [Composer](https://getcomposer.org/): `composer require twbs/bootstrap:5.3.8`
5353
- Install with [NuGet](https://www.nuget.org/): CSS: `Install-Package bootstrap` Sass: `Install-Package bootstrap.sass`
5454

55-
Read the [Getting started page](https://getbootstrap.com/docs/5.3/getting-started/introduction/) for information on the framework contents, templates, examples, and more.
55+
Read the [Getting started page](https://getbootstrap.com/docs/5.3/getting-started/) for information on the framework contents, templates, examples, and more.
5656

5757

5858
## Status

dist/css/bootstrap-utilities.metadata.json

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"aspect-ratio": {
2121
"class": "ratio",
22-
"property": "--bs-ratio",
22+
"property": "--ratio",
2323
"classes": [
2424
"ratio-auto",
2525
"ratio-1x1",
@@ -120,7 +120,7 @@
120120
},
121121
"focus-ring": {
122122
"class": "focus-ring",
123-
"property": "--bs-focus-ring-color",
123+
"property": "--focus-ring-color",
124124
"classes": [
125125
"focus-ring-primary",
126126
"focus-ring-accent",
@@ -522,7 +522,7 @@
522522
},
523523
"grid-column-counts": {
524524
"class": "grid-cols",
525-
"property": "--bs-columns",
525+
"property": "--columns",
526526
"classes": [
527527
"grid-cols-3",
528528
"grid-cols-4",
@@ -918,6 +918,19 @@
918918
"fg-emphasis-secondary"
919919
]
920920
},
921+
"fg-contrast": {
922+
"class": "fg-contrast",
923+
"classes": [
924+
"fg-contrast-primary",
925+
"fg-contrast-accent",
926+
"fg-contrast-success",
927+
"fg-contrast-danger",
928+
"fg-contrast-warning",
929+
"fg-contrast-info",
930+
"fg-contrast-inverse",
931+
"fg-contrast-secondary"
932+
]
933+
},
921934
"fg-opacity": {
922935
"class": "fg",
923936
"property": "color",
@@ -934,19 +947,6 @@
934947
"fg-100"
935948
]
936949
},
937-
"fg-contrast": {
938-
"class": "fg-contrast",
939-
"classes": [
940-
"fg-contrast-primary",
941-
"fg-contrast-accent",
942-
"fg-contrast-success",
943-
"fg-contrast-danger",
944-
"fg-contrast-warning",
945-
"fg-contrast-info",
946-
"fg-contrast-inverse",
947-
"fg-contrast-secondary"
948-
]
949-
},
950950
"link-opacity": {
951951
"class": "link",
952952
"property": "color",
@@ -1077,6 +1077,31 @@
10771077
"bg-100"
10781078
]
10791079
},
1080+
"theme-contrast": {
1081+
"class": "theme-contrast",
1082+
"classes": [
1083+
"theme-contrast"
1084+
]
1085+
},
1086+
"theme-subtle": {
1087+
"class": "theme-subtle",
1088+
"classes": [
1089+
"theme-subtle"
1090+
]
1091+
},
1092+
"theme-muted": {
1093+
"class": "theme-muted",
1094+
"classes": [
1095+
"theme-muted"
1096+
]
1097+
},
1098+
"theme-border": {
1099+
"class": "theme-border",
1100+
"property": "border",
1101+
"classes": [
1102+
"theme-border"
1103+
]
1104+
},
10801105
"gradient": {
10811106
"class": "bg",
10821107
"property": "background-image",

scss/_colors.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// stylelint-disable hue-degree-notation, @stylistic/number-leading-zero
44

55
// Easily convert colors to oklch() with https://oklch.com/
6-
$new-blue: oklch(60% 0.24 258) !default;
6+
$new-blue: oklch(60% 0.24 240) !default;
77
$new-indigo: oklch(56% 0.26 288) !default;
88
$new-violet: oklch(56% 0.24 300) !default;
99
$new-purple: oklch(56% 0.24 320) !default;

scss/_progress.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ $progress-bar-transition: width .6s ease !default;
5757
flex-direction: column;
5858
justify-content: center;
5959
overflow: hidden;
60-
color: var(--progress-bar-color);
60+
color: var(--theme-contrast, var(--progress-bar-color));
6161
text-align: center;
6262
white-space: nowrap;
63-
background-color: var(--progress-bar-bg);
63+
background-color: var(--theme-bg, var(--progress-bar-bg));
6464
@include transition(var(--progress-bar-transition));
6565
}
6666

scss/_utilities.scss

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -735,11 +735,6 @@ $utilities: map.merge(
735735
class: fg-emphasis,
736736
values: theme-color-values("text-emphasis"),
737737
),
738-
"fg-opacity": (
739-
class: fg,
740-
property: color,
741-
values: theme-opacity-values(--fg)
742-
),
743738
"fg-contrast": (
744739
property: (
745740
"--fg": null,
@@ -748,6 +743,11 @@ $utilities: map.merge(
748743
class: fg-contrast,
749744
values: theme-color-values("contrast"),
750745
),
746+
"fg-opacity": (
747+
class: fg,
748+
property: color,
749+
values: theme-opacity-values(--fg)
750+
),
751751
// scss-docs-end utils-color
752752
// scss-docs-start utils-links
753753
"link-opacity": (
@@ -824,6 +824,38 @@ $utilities: map.merge(
824824
values: theme-opacity-values(--bg)
825825
),
826826
// scss-docs-end utils-bg-color
827+
// scss-docs-start utils-theme
828+
// Theme style utilities - pair with .theme-{color} to apply coordinated bg + text colors
829+
"theme-contrast": (
830+
property: (
831+
"background-color": var(--theme-bg),
832+
"color": var(--theme-contrast)
833+
),
834+
class: theme-contrast,
835+
values: (null: null)
836+
),
837+
"theme-subtle": (
838+
property: (
839+
"background-color": var(--theme-bg-subtle),
840+
"color": var(--theme-text)
841+
),
842+
class: theme-subtle,
843+
values: (null: null)
844+
),
845+
"theme-muted": (
846+
property: (
847+
"background-color": var(--theme-bg-muted),
848+
"color": var(--theme-text-emphasis)
849+
),
850+
class: theme-muted,
851+
values: (null: null)
852+
),
853+
"theme-border": (
854+
property: border,
855+
class: theme-border,
856+
values: (null: var(--border-width) solid var(--theme-border))
857+
),
858+
// scss-docs-end utils-theme
827859
"gradient": (
828860
property: background-image,
829861
class: bg,

scss/helpers/_color-bg.scss

Lines changed: 0 additions & 16 deletions
This file was deleted.

scss/helpers/index.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@forward "color-bg";
21
@forward "focus-ring";
32
@forward "icon-link";
43
@forward "position";

site/data/sidebar.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@
109109
icon: magic
110110
icon_color: orange
111111
pages:
112-
- title: Color & background
113112
- title: Focus ring
114113
- title: Icon link
115114
- title: Position
@@ -128,6 +127,7 @@
128127
pages:
129128
- title: Colors
130129
- title: Background
130+
- title: Theme
131131
- group: Layout
132132
pages:
133133
- title: Aspect ratio

site/src/assets/examples/album-rtl/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,6 @@ export const direction = 'rtl'
206206
<a href="#">عد إلى الأعلى</a>
207207
</p>
208208
<p class="mb-1">مثال الألبوم هو © Bootstrap ، ولكن يرجى تنزيله وتخصيصه لنفسك!</p>
209-
<p class="mb-0">جديد على Bootstrap؟ <a href="/"> تفضل بزيارة الصفحة الرئيسية </a> أو اقرأ <a href={getVersionedDocsPath('/getting-started/introduction')}> دليل البدء </a>.</p>
209+
<p class="mb-0">جديد على Bootstrap؟ <a href="/"> تفضل بزيارة الصفحة الرئيسية </a> أو اقرأ <a href={getVersionedDocsPath('/getting-started')}> دليل البدء </a>.</p>
210210
</div>
211211
</footer>

site/src/assets/examples/album/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,6 @@ import Placeholder from "@shortcodes/Placeholder.astro"
205205
<a href="#">Back to top</a>
206206
</p>
207207
<p class="mb-1">Album example is &copy; Bootstrap, but please download and customize it for yourself!</p>
208-
<p class="mb-0">New to Bootstrap? <a href="/">Visit the homepage</a> or read our <a href={getVersionedDocsPath('/getting-started/introduction')}>getting started guide</a>.</p>
208+
<p class="mb-0">New to Bootstrap? <a href="/">Visit the homepage</a> or read our <a href={getVersionedDocsPath('/getting-started/')}>getting started guide</a>.</p>
209209
</div>
210210
</footer>

0 commit comments

Comments
 (0)