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
b615c454
Unverified
Commit
b615c454
authored
2 years ago
by
Julien Déramond
Browse files
Options
Download
Email Patches
Plain Diff
Combine :host to :root so that Web Components can access CSS vars
parent
cbc4e3a4
main-jd-use-host
1 merge request
!37162
Use `:host` in selectors to support Web Components
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
scss/_grid.scss
+2
-1
scss/_grid.scss
scss/_reboot.scss
+2
-1
scss/_reboot.scss
scss/_root.scss
+1
-0
scss/_root.scss
scss/_variables.scss
+1
-1
scss/_variables.scss
scss/mixins/_color-mode.scss
+1
-1
scss/mixins/_color-mode.scss
site/content/docs/5.3/customize/css-variables.md
+1
-1
site/content/docs/5.3/customize/css-variables.md
with
8 additions
and
5 deletions
+8
-5
scss/_grid.scss
+
2
-
1
View file @
b615c454
...
...
@@ -2,7 +2,8 @@
//
// Rows contain your columns.
:root
{
:root
,
:host
{
@each
$name
,
$value
in
$grid-breakpoints
{
--
#{
$prefix
}
breakpoint-
#{
$name
}
:
#{
$value
}
;
}
...
...
This diff is collapsed.
Click to expand it.
scss/_reboot.scss
+
2
-
1
View file @
b615c454
...
...
@@ -25,7 +25,8 @@
// Ability to the value of the root font sizes, affecting the value of `rem`.
// null by default, thus nothing is generated.
:root
{
:root
,
:host
{
@if
$font-size-root
!=
null
{
@include
font-size
(
var
(
--
#{
$prefix
}
root-font-size
));
}
...
...
This diff is collapsed.
Click to expand it.
scss/_root.scss
+
1
-
0
View file @
b615c454
:root
,
:host
,
[
data-bs-theme
=
"light"
]
{
// Note: Custom variable values only support SassScript inside `#{}`.
...
...
This diff is collapsed.
Click to expand it.
scss/_variables.scss
+
1
-
1
View file @
b615c454
...
...
@@ -387,7 +387,7 @@ $enable-important-utilities: true !default;
$enable-dark-mode
:
true
!
default
;
$color-mode-type
:
data
!
default
;
// `data` or `media-query`
// Prefix for :root CSS variables
// Prefix for
'
:root
, :host'
CSS variables
$variable-prefix
:
bs-
!
default
;
// Deprecated in v5.2.0 for the shorter `$prefix`
$prefix
:
$variable-prefix
!
default
;
...
...
This diff is collapsed.
Click to expand it.
scss/mixins/_color-mode.scss
+
1
-
1
View file @
b615c454
...
...
@@ -3,7 +3,7 @@
@if
$color-mode-type
==
"media-query"
{
@if
$root
==
true
{
@media
(
prefers-color-scheme
:
$mode
)
{
:root
{
:root
,
:host
{
@content
;
}
}
...
...
This diff is collapsed.
Click to expand it.
site/content/docs/5.3/customize/css-variables.md
+
1
-
1
View file @
b615c454
...
...
@@ -21,7 +21,7 @@ These CSS variables are available everywhere, regardless of color mode.
```
css
{
{<
root.inline
>
}
}
{
{-
$
css
:
=
readFile
"dist/css/bootstrap.css"
-
}
}
{
{-
$
match
:
=
findRE
`
:
root
,
\
n
\
[
data-bs-theme
=
light
\
]
{
([
^
}
]*)
}`
$
css
1
-
}}
{
{-
$
match
:
=
findRE
`
:
root
,
\
n
:
host
,
\
n
\
[
data-bs-theme
=
light
\
]
{
([
^
}
]*)
}`
$
css
1
-
}}
{
{-
if
(eq
(len
$match)
0)
-
}
}
{
{-
errorf
"Got
no
matches
for
:
root
in
%
q
!"
$
.
Page
.
Path
-
}
}
...
...
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