Skip to content

Commit fa86b1a

Browse files
authored
Merge branch 'ouds/main' into ouds/main-ml-component-finder
2 parents ba96f5b + d873a8f commit fa86b1a

11 files changed

Lines changed: 94 additions & 14 deletions

File tree

scss/forms/_control-item.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@
247247
mask-repeat: no-repeat;
248248
}
249249

250-
&:indeterminate,
250+
&[type="checkbox"]:indeterminate,
251251
&:checked {
252252
--#{$prefix}control-item-indicator-color: #{$ouds-color-action-selected};
253253
}

site/data/sidebar-getting-started.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
- title: Color palette
3939
- title: Color modes
4040
- title: CSS variables
41-
draft: true
4241
- title: Reboot
4342
- title: Typography
4443
- title: Images

site/src/components/header/Skippy.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const { layout } = Astro.props
1111
<a id="top"></a><!-- OUDS mod: anchor for back-to-top link -->
1212
<div class="skippy visually-hidden-focusable overflow-hidden position-fixed top-0 end-0 start-0">
1313
<nav aria-label="Skip links" class="container-fluid container-max-width py-2xsmall ps-4xlarge">
14-
<a class="d-inline-flex p-small ms-large bg-always-black" href="#content">Skip to main content</a>
14+
<a class="d-inline-flex p-small ms-large bg-always-black" href="#bd-content">Skip to main content</a>
1515
{
1616
layout === 'docs' && (
1717
<a class="d-none d-md-inline-flex p-small bg-always-black" href="#bd-docs-nav">

site/src/components/home/MastHead.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Code from '@components/shortcodes/Code.astro'
66

77
<div
88
class="bd-masthead position-relative"
9-
id="content"
9+
id="bd-content"
1010
{...(getConfig().brand === 'orange' || getConfig().brand === 'orange-compact') && { 'data-bs-theme': 'dark' }}
1111
>
1212
<div class="bd-masthead-bg position-absolute w-100 h-100"></div>

site/src/components/shortcodes/Code.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ let codeToDisplay = filePath
5757
: code
5858
5959
if (filePath && fileMatch && codeToDisplay) {
60-
const match = codeToDisplay.match(new RegExp(fileMatch))
60+
const match = codeToDisplay.match(new RegExp(fileMatch, 'g'))
6161
6262
if (!match || !match[0]) {
63-
throw new Error(`The file at ${filePath} does not contains a match for the regex '${fileMatch}'.`)
63+
throw new Error(`The file at ${filePath} does not contain a match for the regex '${fileMatch}'.`)
6464
}
6565
66-
codeToDisplay = match[0]
66+
codeToDisplay = match.join('\n\n')
6767
}
6868
---
6969

site/src/content/docs/dual-mode.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
---
2-
title: Dual mode explanation
2+
title: Dual Mode explanation
33
description: This is a tutorial for the dual-mode using Boosted and OUDS Web.
44
aliases:
55
- "/docs/[[config:docs_version]]/bi-mode/"
6+
- "/docs/dual-mode/"
67
- "/dual-mode/"
78
- "/bi-mode/"
89
toc: true
910
---
1011

1112
## Preamble
1213

13-
Dual-mode is a way to early and gradually migrate a Boosted project to OUDS.
14+
Dual-Mode is a way to early and gradually migrate a Boosted project to OUDS.
1415

1516
This page is for people that want to try the dual-mode combining Boosted and OUDS Web. It also works as a tutorial to implement OUDS Web gradually inside your website. Be careful, we will support this in a “best-effort” way ; this feature is supposed to be mainly used by pre-selected projects. If you need any assistance, please [contact us]([[docsref:/about/team]]).
1617
This page is not to be used alone, but is complementary to [OUDS Web documentation](https://web.unified-design-system.orange.com/) and [Boosted documentation](https://boosted.orange.com/).

site/src/content/docs/foundation/css-variables.mdx

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,84 @@ aliases:
77
toc: true
88
---
99

10-
<CalloutSoon type="page" />
10+
import { getConfig } from '@libs/config'
11+
12+
OUDS Web includes many [CSS custom properties (variables)](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties) in its compiled CSS for real-time customization without the need to recompile Sass. These provide easy access to commonly used values like our theme colors, breakpoints, spacings, and primary font stacks when working in your browser’s inspector, a code sandbox, or general prototyping.
13+
14+
**All our custom properties are prefixed with `bs-`** to avoid conflicts with third party CSS.
15+
16+
## Root variables
17+
18+
Here are the variables we include (note that the `:root` is required) that can be accessed anywhere OUDS Web’s CSS is loaded. They’re located in our `_root.scss` file in our common package and included in our compiled dist files in the theme package. But we also provide many semantic tokens in this form (mainly colors) in our `_semantic-colors-custom-props.scss` in the theme package and included in our compiled dist files.
19+
20+
### Default
21+
22+
These CSS variables are available everywhere, regardless of color mode.
23+
24+
<Code lang="css" filePath={`packages/${getConfig().brand}/dist/css/ouds-web.css`} fileMatch="(:root,\n\[data-bs-theme=light\],\n:root\[data-bs-theme=light\] \[data-bs-theme=root\],\n:root\[data-bs-theme=dark\] \[data-bs-theme=root-inverted\] {[^}]*})" />
25+
26+
### Dark mode
27+
28+
These variables are scoped to our built-in dark mode.
29+
30+
<Code lang="css" filePath={`packages/${getConfig().brand}/dist/css/ouds-web.css`} fileMatch="(\[data-bs-theme=dark\],\n:root\[data-bs-theme=dark\],\n:root\[data-bs-theme=dark\] \[data-bs-theme=root\],\n:root\[data-bs-theme=light\] \[data-bs-theme=root-inverted\] {[^}]*})" />
31+
32+
## Component variables
33+
34+
OUDS Web is increasingly making use of custom properties as local variables for various components. This way we reduce our compiled CSS, ensure styles aren’t inherited in places like nested tables, and allow some basic restyling and extending of OUDS Web components after Sass compilation.
35+
36+
{/* Have a look at our table documentation for some [insight into how we’re using CSS variables]([[docsref:/content/tables#how-do-the-variants-and-accented-tables-work]]). Our [navbars also use CSS variables]([[docsref:/components/navbar#css]]) as of v5.2.0. */}
37+
We’re using CSS variables across our grids—primarily for gutters in the [new opt-in CSS grid]([[docsref:/layout/css-grid]])—with more component usage coming in the future.
38+
39+
Whenever possible, we’ll assign CSS variables at the base component level (e.g., `.breadcrumb` for breadcrumb and its sub-components). This reduces guessing on where and how to customize, and allows for easy modifications by our team in future updates.
40+
41+
## Prefix
42+
43+
Most CSS variables use a prefix to avoid collisions with your own codebase. This prefix is in addition to the `--` that’s required on every CSS variable.
44+
45+
Customize the prefix via the `$prefix` Sass variable. By default, it’s set to `bs-` (note the trailing dash).
46+
47+
{/* OUDS Web mod */}
48+
## Deduping embedded SVGs
49+
50+
OUDS Web uses embedded SVGs as data URIs in the wild, which means extremely long strings in CSS. When one of them is used several times in the stylesheet, CSS custom properties allow to factorize its string—thus decreasing the output file size.
51+
52+
```css
53+
:root {
54+
--bs-chevron-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 14'%3e%3cpath d='M9 2L7 0 0 7l7 7 2-2-5-5 5-5z'/%3e%3c/svg%3e");
55+
}
56+
57+
.back-to-top-link::after {
58+
background-image: var(--bs-chevron-icon);
59+
}
60+
61+
.pagination-item:first-child .page-link::before {
62+
background-image: var(--bs-chevron-icon);
63+
}
64+
```
65+
{/* End mod */}
66+
67+
## Examples
68+
69+
CSS variables offer similar flexibility to Sass’s variables, but without the need for compilation before being served to the browser. For example, here we’re resetting our page’s font and link styles with CSS variables.
70+
71+
```css
72+
body {
73+
font: 1rem/1.5 var(--bs-font-body-family);
74+
}
75+
a {
76+
color: var(--bs-color-content-brand-primary);
77+
}
78+
```
79+
80+
## `:focus-visible` variables
81+
82+
OUDS Web provides custom `:focus-visible` (which is supported by OUDS Web) styles using a combination of Sass and CSS variables that can be optionally added to specific components and elements. This focus is removed for form elements.
83+
84+
<ScssDocs name="focus-visible" file="scss/mixins/_focus.scss" />
85+
86+
To completely remove this style, add `outline: 0;` and `box-shadow: none;`.
87+
88+
## Grid breakpoints
89+
90+
While we include our grid breakpoints as CSS variables (except for `2xs`), be aware that **CSS variables do not work in media queries**. This is by design in the CSS spec for variables, but may change in coming years with support for `env()` variables. Check out [this Stack Overflow answer](https://stackoverflow.com/a/47212942) for some helpful links. In the meantime, you can use these variables in other CSS situations, as well as in your JavaScript.

site/src/layouts/DocsLayout.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const multipleComponents = componentsVersions.length > 1 ? 's' : ''
9595
View on GitHub
9696
</a>
9797
</div>
98-
<h1 class="bd-title mb-none" id="content">{frontmatter.title}</h1>
98+
<h1 class="bd-title mb-none" id="bd-content">{frontmatter.title}</h1>
9999
</div>
100100
<div class="bd-subtitle mt-small">
101101
{frontmatter.description && <Fragment set:html={processMarkdownToHtml(frontmatter.description)} />}

site/src/layouts/ExamplesLayout.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const {
2121
theme_selector = true
2222
} = Astro.props
2323
24-
const pageTitle = `${title} · ${getConfig().title} v${getConfig().docs_version}`
24+
const pageTitle = `${title} example · ${getConfig().title} v${getConfig().docs_version}`
2525
const canonicalUrl = new URL(Astro.url.pathname, Astro.site)
2626
2727
const htmlProps: HTMLAttributes<'html'> = direction === 'rtl' ? { lang: 'ar', dir: 'rtl' } : { lang: 'en' }

site/src/layouts/RedirectLayout.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const url = new URL(path, Astro.site)
1515
<head>
1616
<meta charset="utf-8" />
1717
<meta name="viewport" content="width=device-width, initial-scale=1" />
18-
<title>{getConfig().title}</title>
18+
<title>Redirecting - {getConfig().title}</title>
1919
<link rel="canonical" href={url} />
2020
<meta name="robots" content="noindex" />
2121
<script define:vars={{ url: url}}>

0 commit comments

Comments
 (0)