Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bundlewatch.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"path": "./packages/orange/dist/css/ouds-web-bootstrap.min.css",
"maxSize": "79.25 kB"
"maxSize": "79.5 kB"
},
{
"path": "./packages/orange/dist/css/ouds-web-grid.css",
Expand Down
10 changes: 9 additions & 1 deletion scss/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,15 @@
var(--#{$prefix}color-opacity-transparent),
var(--#{$prefix}color-content-on-action-loading)
);

&.opacify {
&:hover,
&:active,
&:focus-visible {
background-color: var(--bs-color-bg-primary);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
background-color: var(--bs-color-bg-primary);
background-color: var(--#{$prefix}color-bg-primary);

background-image: linear-gradient(var(--#{$prefix}btn-hover-bg));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we keep the hover every time ? Where can the specs be found ?

}
}
}

.btn-negative {
Expand Down Expand Up @@ -526,4 +535,3 @@
height: var(--#{$prefix}btn-icon-size);
background-color: currentcolor;
}

1 change: 1 addition & 0 deletions scss/_helpers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// OUDS mod: no @import "helpers/colored-links";
@import "helpers/focus-ring";
@import "helpers/icon";
@import "helpers/text-opacify";
// OUDS mod: no import of `icon-link`
@import "helpers/position";
@import "helpers/stacks";
Expand Down
9 changes: 9 additions & 0 deletions scss/_links.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@
font-size: var(--#{$prefix}link-icon-size);
line-height: 1;
}

&.opacify {
&:hover,
&:active,
&:focus-visible {
background-color: var(--bs-color-bg-primary);
background-clip: text;
}
}
}

.link-chevron {
Expand Down
4 changes: 4 additions & 0 deletions scss/helpers/_text-opacify.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.text-muted.opacify {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know if there is a name on design side for this .opacify class ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no design spec for this

background-color: var(--bs-color-bg-primary);
background-clip: text;
}
17 changes: 17 additions & 0 deletions site/src/content/docs/components/buttons.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,23 @@ Add `.btn-icon` to get a squared button, meant to only contain an icon. Make sur
</div>
</div>`} />

#### Opaque buttons

On image background, you can use the `.opacify` class to make buttons more readable. This class adds an opaque background to the button, improving contrast and visibility against complex backgrounds.

<Callout type="info">
The `.opacify` class is only available for `.btn-strong` buttons.
</Callout>

<Example buttonLabel="buttons on colored backgrounds" class="p-none bd-btn-example bd-first-rounded" code={`<div class="bg-surface-brand-primary p-large d-flex gap-xsmall flex-wrap" style="background-image: url('https://fastly.picsum.photos/id/628/1000/300.jpg?hmac=scpBB5Z4eJBipw0O_j2T60oQcGjH8xoOA0OG42tW0go')">

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this url something internal that can be used in this context ? shouldn't we get this asset in our repo to avoid depending on external resources ?

<div data-bs-theme="light" class="d-flex gap-xsmall flex-wrap">
<button type="button" class="btn btn-strong opacify">Strong</button>
</div>
<div data-bs-theme="dark">
<button type="button" class="btn btn-strong opacify">Strong</button>
</div>
</div>`} />

#### Outline buttons

<BootstrapCompatibility>
Expand Down
14 changes: 14 additions & 0 deletions site/src/content/docs/components/links.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,20 @@ Take a regular `<a>` element, add `.icon-link`, and insert an icon on the left o
</a>`} />
</BootstrapCompatibility>

### Opaque links

On image background, you can use the `.opacify` class to make links more readable. This class adds an opaque background to the link for the `:hover`, `:focus-visible`, and `:active` states, improving contrast and visibility against complex backgrounds.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it apply only on some variants of the links ?


<Example buttonLabel="links on colored backgrounds" class="p-none bd-btn-example bd-first-rounded" code={`<div class="bg-surface-brand-primary p-large d-flex gap-medium flex-wrap" style="background-image: url('https://fastly.picsum.photos/id/628/1000/300.jpg?hmac=scpBB5Z4eJBipw0O_j2T60oQcGjH8xoOA0OG42tW0go')">
<div data-bs-theme="light">
<a class="link opacify" href="#">Link</a>
</div>
<div data-bs-theme="dark">
<a class="link opacify" href="#">Link</a>
</div>
</div>`} />


## States

### Disabled
Expand Down
12 changes: 12 additions & 0 deletions site/src/content/docs/getting-started/migration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,20 @@ toc: true

- <span class="tag tag-small tag-info"><span class="tag-status-icon"></span>Info</span> Badge - icon component has been updated to 1.3.0. Read more in the [badge - icon design changelog](https://r.orange.fr/r/S-ouds-doc-badge-icon_changelog).

#### Buttons

- <span class="tag tag-small tag-positive"><span class="tag-status-icon"></span>New</span> `.opacify` helper class has been added to improve `.btn-strong` button readability on complex backgrounds. Read more in our [buttons page]([[docsref:/components/buttons#opaque-buttons]]).

#### Chips

- <span class="tag tag-small tag-info"><span class="tag-status-icon"></span>Info</span> Suggestion chip component has been updated to 1.4.0 with no outward changes. Read more in the [suggestion chip design changelog](https://r.orange.fr/r/S-ouds-doc-suggestion-chip_changelog).

- <span class="tag tag-small tag-info"><span class="tag-status-icon"></span>Info</span> Filter chip component has been updated to 1.4.0 with no outward changes. Read more in the [filter chip design changelog](https://r.orange.fr/r/S-ouds-doc-filter-chip_changelog).

#### Links

- <span class="tag tag-small tag-positive"><span class="tag-status-icon"></span>New</span> `.opacify` helper class has been added to improve link readability on complex backgrounds. Read more in our [links page]([[docsref:/components/links#opaque-links]]).

#### Password input

- <span class="tag tag-small tag-info"><span class="tag-status-icon"></span>Info</span> Password input component has been updated to 1.3.0 with no outward changes. Read more in the [password input design changelog](https://r.orange.fr/r/S-ouds-doc-password-input_changelog).
Expand All @@ -51,6 +59,10 @@ toc: true

### Utilities

#### Color

- <span class="tag tag-small tag-positive"><span class="tag-status-icon"></span>New</span> `.opacify` helper class has been added to improve `.text-muted` readability on complex backgrounds. Read more in our [color page]([[docsref:/utilities/color#opaque-text-muted]]).

#### Shadow

- <span class="tag tag-small tag-warning"><span class="tag-status-icon"></span>Warning</span> `.shadow-default` has been deprecated in favor of `.shadow-elevated`. It will be removed in v1.5.0. Read more in our [shadow page]([[docsref:/utilities/shadow]]).
Expand Down
14 changes: 14 additions & 0 deletions site/src/content/docs/utilities/color.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,17 @@ See [icons documentation]([[docsref:/components/icon#icons-color]]) to learn how
## Specificity

Sometimes contextual classes cannot be applied due to the specificity of another selector. In some cases, a sufficient workaround is to wrap your element’s content in a `<div>` or more semantic element with the desired class.


## Opaque text muted

On image background, you can use the `.opacify` class to make `.text-muted` more readable. This class adds an opaque background to the text, improving contrast and visibility against complex backgrounds.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why on text-muted only ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the only semi-transparent color

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also have .text-disabled but ok I see your point


<Example buttonLabel="links on colored backgrounds" class="p-none bd-btn-example bd-first-rounded" code={`<div class="bg-surface-brand-primary p-large d-flex gap-medium flex-wrap" style="background-image: url('https://fastly.picsum.photos/id/534/1000/300.jpg?hmac=uKVRRoCBPDGUvOZ5ZockbHITRiP-GoVWyQ2WtBpcrB8')">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good accessibility practice is to set a background-color close to the color on the image whenever an image is used. Do you think we should add this good practice in our doc ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok but do we have enough colors for that?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so

<div data-bs-theme="light">
<p class="text-muted p-small fs-hl opacify">Text muted</p>
</div>
<div data-bs-theme="dark">
<p class="text-muted p-small fs-hl opacify">Text muted</p>
</div>
</div>`} />
Loading