Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions .bundlewatch.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"files": [
{
"path": "./packages/orange/dist/css/ouds-web-bootstrap.css",
"maxSize": "72.5 kB"
"maxSize": "72.75 kB"
},
{
"path": "./packages/orange/dist/css/ouds-web-bootstrap.min.css",
"maxSize": "68.80 kB"
"maxSize": "69.0 kB"
},
{
"path": "./packages/orange/dist/css/ouds-web-grid.css",
Expand Down
2 changes: 1 addition & 1 deletion packages/orange-compact/scss/tokens/_composite.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ $ouds-font-family-monospace-stack:

$chevron-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000'><path d='M597.22 225 402.78 421.43 325 500l77.78 78.57L597.22 775 675 696.43 480.56 500 675 303.57z'/></svg>") !default;
$cross-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'><path d='m15 17.121-8.132 8.132-2.121-2.12L12.879 15 4.747 6.868l2.12-2.121L15 12.879l8.132-8.132 2.12 2.121L17.122 15l8.132 8.132-2.121 2.12L15 17.123z'/></svg>") !default;
$cross-icon-stroke: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='116 116 767 767'><path d='M817.493 676.165a49.977 49.977 0 0 1 0 70.664l-70.664 70.664a49.977 49.977 0 0 1-70.664 0L499.5 640.828 322.835 817.493a49.977 49.977 0 0 1-70.664 0l-70.664-70.664a49.977 49.977 0 0 1 0-70.664L358.172 499.5 181.507 322.835a49.977 49.977 0 0 1 0-70.664l70.664-70.664a49.977 49.977 0 0 1 70.664 0L499.5 358.172l176.665-176.665a49.977 49.977 0 0 1 70.664 0l70.664 70.664a49.977 49.977 0 0 1 0 70.664L640.828 499.5Z'/></svg>") !default;
$cross-icon-stroke: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='m18.75 7.178-1.928-1.929L12 10.071 7.178 5.25 5.249 7.18 10.071 12 5.25 16.822l1.93 1.929L12 13.929l4.822 4.822 1.929-1.929L13.929 12l4.822-4.822Z'/></svg>") !default;
$burger-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'><path d='M28 21v2H2v-2h26Zm0-7v2H2v-2h26Zm0-7v2H2V7h26Z'/></svg>") !default;
$burger-icon-small: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 25 25'><path d='M2 19h21v-2H2v2Zm0-6h21v-2H2v2Zm0-6h21V5H2v2Z'/></svg>") !default;
$add-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'><path fill='currentColor' d='M14 6H8V0H6v6H0v2h6v6h2V8h6V6z'/></svg>") !default;
Expand Down
2 changes: 1 addition & 1 deletion packages/orange-compact/scss/tokens/_index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "raw"; // TODO: Make it a tokenator file ?
@import "raw";
@import "semantic";
@import "semantic-colors-custom-props";
@import "composite";
Expand Down
2 changes: 1 addition & 1 deletion packages/orange/scss/tokens/_composite.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ $ouds-font-family-monospace-stack:

$chevron-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000'><path d='M597.22 225 402.78 421.43 325 500l77.78 78.57L597.22 775 675 696.43 480.56 500 675 303.57z'/></svg>") !default;
$cross-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'><path d='m15 17.121-8.132 8.132-2.121-2.12L12.879 15 4.747 6.868l2.12-2.121L15 12.879l8.132-8.132 2.12 2.121L17.122 15l8.132 8.132-2.121 2.12L15 17.123z'/></svg>") !default;
$cross-icon-stroke: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='116 116 767 767'><path d='M817.493 676.165a49.977 49.977 0 0 1 0 70.664l-70.664 70.664a49.977 49.977 0 0 1-70.664 0L499.5 640.828 322.835 817.493a49.977 49.977 0 0 1-70.664 0l-70.664-70.664a49.977 49.977 0 0 1 0-70.664L358.172 499.5 181.507 322.835a49.977 49.977 0 0 1 0-70.664l70.664-70.664a49.977 49.977 0 0 1 70.664 0L499.5 358.172l176.665-176.665a49.977 49.977 0 0 1 70.664 0l70.664 70.664a49.977 49.977 0 0 1 0 70.664L640.828 499.5Z'/></svg>") !default;
$cross-icon-stroke: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='m18.75 7.178-1.928-1.929L12 10.071 7.178 5.25 5.249 7.18 10.071 12 5.25 16.822l1.93 1.929L12 13.929l4.822 4.822 1.929-1.929L13.929 12l4.822-4.822Z'/></svg>") !default;
$burger-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'><path d='M28 21v2H2v-2h26Zm0-7v2H2v-2h26Zm0-7v2H2V7h26Z'/></svg>") !default;
$burger-icon-small: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 25 25'><path d='M2 19h21v-2H2v2Zm0-6h21v-2H2v2Zm0-6h21V5H2v2Z'/></svg>") !default;
$add-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'><path fill='currentColor' d='M14 6H8V0H6v6H0v2h6v6h2V8h6V6z'/></svg>") !default;
Expand Down
2 changes: 1 addition & 1 deletion packages/sosh/scss/tokens/_composite.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ $ouds-font-family-monospace-stack:

$chevron-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M16.142 17.019c-.015-.015.018.015 0 0l-5.55-4.905 5.55-4.811c.618-.615.506-1.388 0-1.913-.015-.019.018.015 0 0-.566-.536-1.448-.506-2.037.008L7.397 11.21c-.552.48-.507 1.286 0 1.808l6.708 5.883c.717.717 1.545.574 2.037.094.491-.48.652-1.339 0-1.976Z'/></svg>") !default;
$cross-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M18.397 5.603c.47.471.47 1.235 0 1.706l-4.691 4.69 4.69 4.692a1.207 1.207 0 0 1-1.705 1.706L12 13.705l-4.691 4.692a1.207 1.207 0 0 1-1.706-1.706L10.294 12l-4.69-4.69a1.207 1.207 0 0 1 1.705-1.706L12 10.293l4.691-4.69c.47-.47 1.235-.47 1.706 0Z'/></svg>") !default;
$cross-icon-stroke: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M18.397 5.603c.47.471.47 1.235 0 1.706l-4.691 4.69 4.69 4.692a1.207 1.207 0 0 1-1.705 1.706L12 13.705l-4.691 4.692a1.207 1.207 0 0 1-1.706-1.706L10.294 12l-4.69-4.69a1.207 1.207 0 0 1 1.705-1.706L12 10.293l4.691-4.69c.47-.47 1.235-.47 1.706 0Z'/></svg>") !default;
$cross-icon-stroke: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M18.397 5.603c.47.47.47 1.235 0 1.706l-4.691 4.69 4.69 4.692a1.207 1.207 0 0 1-1.705 1.706L12 13.705l-4.691 4.692a1.207 1.207 0 0 1-1.706-1.706l4.691-4.692-4.69-4.69a1.207 1.207 0 0 1 1.705-1.706L12 10.293l4.691-4.69c.47-.47 1.235-.47 1.706 0Z'/></svg>") !default;
$burger-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M2.25 6.6c0-.746.604-1.35 1.35-1.35h16.8a1.35 1.35 0 1 1 0 2.7H3.6A1.35 1.35 0 0 1 2.25 6.6Zm0 5.4c0-.746.604-1.35 1.35-1.35h16.8a1.35 1.35 0 1 1 0 2.7H3.6A1.35 1.35 0 0 1 2.25 12Zm1.35 4.05a1.35 1.35 0 1 0 0 2.7h16.8a1.35 1.35 0 1 0 0-2.7H3.6Z'/></svg>") !default;
$burger-icon-small: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M2.25 6.6c0-.746.604-1.35 1.35-1.35h16.8a1.35 1.35 0 1 1 0 2.7H3.6A1.35 1.35 0 0 1 2.25 6.6Zm0 5.4c0-.746.604-1.35 1.35-1.35h16.8a1.35 1.35 0 1 1 0 2.7H3.6A1.35 1.35 0 0 1 2.25 12Zm1.35 4.05a1.35 1.35 0 1 0 0 2.7h16.8a1.35 1.35 0 1 0 0-2.7H3.6Z'/></svg>") !default;
$add-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M18.25 13.247a1.25 1.25 0 0 0 0-2.5h-5v-5a1.25 1.25 0 1 0-2.5 0v5h-5a1.25 1.25 0 1 0 0 2.5h5v5a1.25 1.25 0 0 0 2.5 0v-5h5Z'/></svg>") !default;
Expand Down
2 changes: 1 addition & 1 deletion packages/sosh/scss/tokens/_index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "raw"; // TODO: Make it a tokenator file ?
@import "raw";
@import "semantic";
@import "semantic-colors-custom-props";
@import "composite";
Expand Down
295 changes: 163 additions & 132 deletions scss/_alert.scss
Original file line number Diff line number Diff line change
@@ -1,166 +1,197 @@
//
// Base styles
//
#{$ouds-root-selector} {
--#{$prefix}alert-border-radius: #{$ouds-alert-border-radius-default};
}

.alert {
// scss-docs-start alert-css-vars
--#{$prefix}alert-bg: transparent;
--#{$prefix}alert-padding-x: #{$alert-padding-x};
--#{$prefix}alert-padding-y: #{$alert-padding-y};
--#{$prefix}alert-margin-bottom: #{$alert-margin-bottom};
@include rfs($font-size-base, --#{$prefix}alert-font-size); // OUDS mod
--#{$prefix}alert-line-height: #{$line-height-base}; // OUDS mod
--#{$prefix}alert-color: #{$alert-color}; // OUDS mod
--#{$prefix}alert-border-color: transparent;
--#{$prefix}alert-border: #{$alert-border-width} solid var(--#{$prefix}alert-border-color);
--#{$prefix}alert-border-radius: #{$alert-border-radius};
// OUDS mod: no `--#{$prefix}alert-link-color`
--#{$prefix}alert-logo-size: #{$alert-logo-size}; // OUDS mod
--#{$prefix}alert-icon-size: #{$alert-icon-size}; // OUDS mod
--#{$prefix}alert-icon-margin-y: #{$alert-icon-margin-y}; // OUDS mod
--#{$prefix}alert-link-font-weight: #{$alert-link-font-weight}; // OUDS mod
--#{$prefix}alert-heading-font-weight: #{$alert-heading-font-weight}; // OUDS mod
--#{$prefix}alert-dismissible-padding-right: #{$alert-dismissible-padding-r}; // OUDS mod
--#{$prefix}alert-btn-close-offset: #{$alert-btn-close-offset}; // OUDS mod
// scss-docs-end alert-css-vars

position: relative;
display: flex; // OUDS mod
padding: var(--#{$prefix}alert-padding-y) var(--#{$prefix}alert-padding-x);
margin-bottom: var(--#{$prefix}alert-margin-bottom);
@include font-size(var(--#{$prefix}alert-font-size));
line-height: var(--#{$prefix}alert-line-height);
color: var(--#{$prefix}alert-color);
background-color: var(--#{$prefix}alert-bg);
border: var(--#{$prefix}alert-border);
display: flex;
gap: $ouds-alert-space-column-gap;
align-items: flex-start;
@include border-radius(var(--#{$prefix}alert-border-radius));
}

// Headings for larger alerts
.alert-heading {
// OUDS mod: ensure headings look like paragraphs
margin: 0;
font-size: inherit;
font-weight: var(--#{$prefix}alert-heading-font-weight);
line-height: inherit;
// End mod
// Specified to prevent conflicts of changing $headings-color
color: inherit;
}
.alert-message {
--#{$prefix}alert-icon-margin-top: #{$ouds-alert-space-padding-block}; // Here to avoid an encapsulation
min-width: $ouds-alert-size-min-width;
min-height: $ouds-alert-size-min-height;
padding-inline: $ouds-alert-space-padding-inline;
background-color: var(--#{$prefix}alert-bg);
border: var(--#{$prefix}alert-border-color) solid $ouds-alert-border-width;

// Provide class for links that match alerts
.alert-link {
font-weight: var(--#{$prefix}alert-link-font-weight); // OUDS mod
// OUDS mod: no `color`
&:has(.btn) {
padding-right: 0;
}

&:has(.alert-container > .link) {
min-height: $ouds-alert-size-min-height-bottom-action-placement;
}

// To avoid overflow: hidden that hides the focus
.btn {
@include border-top-end-radius(var(--#{$prefix}alert-border-radius));
}

&:not(:has(p:not(.alert-label), .bullet-list, .alert-container .link)) .btn {
@include border-bottom-end-radius(var(--#{$prefix}alert-border-radius));
}
}

.alert-icon {
position: relative;
display: block;
flex-shrink: 0;
width: px-to-rem($ouds-alert-size-icon);
height: px-to-rem($ouds-alert-size-icon);
margin-block: var(--#{$prefix}alert-icon-margin-top);
color: var(--#{$prefix}alert-icon-color);

&:where(:not(:has(svg, img, .icon))) {
&::before,
&::after {
position: absolute;
inset: 0;
display: block;
content: "";
}

// Dismissible alerts
//
// Expand the right padding and account for the close button's positioning.
&::before {
background-color: currentcolor;
mask-image: escape-svg(var(--#{$prefix}alert-icon));
}

.alert-dismissible {
padding-right: var(--#{$prefix}alert-dismissible-padding-right); // OUDS mod
&::after {
background-color: var(--#{$prefix}alert-icon-internal-color);
mask-image: escape-svg(var(--#{$prefix}alert-icon-internal));
}
}

// Adjust close link position
.btn-close {
position: absolute;
top: var(--#{$prefix}alert-btn-close-offset); // OUDS mod
right: var(--#{$prefix}alert-btn-close-offset); // OUDS mod
z-index: $stretched-link-z-index + 1;
// OUDS mod: no padding
svg,
img,
.icon {
width: 100%;
height: 100%;
font-size: $ouds-alert-size-icon;
line-height: 1;
vertical-align: baseline; // TODO: For reboot maybe ?
}
}

.alert-container {
display: flex;
flex-grow: 1;
flex-direction: column;
gap: $ouds-alert-space-row-gap-action;
align-items: flex-start;
justify-content: center;
min-height: $ouds-alert-size-min-height;
padding-block: $ouds-alert-space-padding-block;
}

// scss-docs-start alert-modifiers
// Generate contextual modifier classes for colorizing the alert.
.alert-text-container {
display: flex;
flex-direction: column;
gap: $ouds-alert-space-row-gap;
color: $ouds-color-content-muted;

> *,
.bullet-list.fs-bm {
--#{$prefix}bullet-list-icon-container-width: #{calc(px-to-rem($ouds-size-icon-with-label-medium-size-medium) - $ouds-bullet-list-space-padding-inline-level-0)}; // TODO: Do we need a token for that ?
--#{$prefix}bullet-list-padding-block: #{$ouds-alert-space-row-gap-bullet / 2};
--#{$prefix}bullet-color: var(--#{$prefix}color-content-default);
max-width: var(--#{$prefix}font-max-width-label-medium);
margin-bottom: 0;
@include get-font-size("label-medium");
font-weight: $ouds-font-weight-web-label-default;
}
}

@each $state, $value in $alert-colors {
.alert-#{$state} {
// OUDS mod: no --#{$prefix}alert-color
--#{$prefix}alert-border-color: var(--#{$prefix}#{$state}-border-subtle);
// OUDS mod: no `--#{$prefix}alert-link-color`
// OUDS mod
@if type-of(map-get($alert-icons, $state)) == "list" {
--#{$prefix}alert-icon-bg-image: #{nth(map-get($alert-icons, $state), 1)};
.alert-action-container {
display: flex;
gap: $ouds-alert-space-column-gap-action;
}

.alert-icon::before {
background: var(--#{$prefix}alert-icon-bg-image) no-repeat top left / var(--#{$prefix}alert-logo-size);
.alert-label {
max-width: var(--#{$prefix}font-max-width-label-large);
margin-bottom: 0;
@include get-font-size("label-large");
font-weight: $ouds-font-weight-web-label-moderate;
color: $ouds-color-content-default;
}

/* rtl:raw:
background-position: top right;
*/
mask: none;
}
} @else {
--#{$prefix}alert-icon-bg-image: #{map-get($alert-icons, $state)};
}
// End mod
}
.use-rounded-corner-alert {
--#{$prefix}alert-border-radius: #{$ouds-alert-border-radius-rounded};
}
// scss-docs-end alert-modifiers

//
// OUDS mod
//
.alert-neutral {
--#{$prefix}component-icon-color: #{$ouds-color-content-default};
--#{$prefix}alert-bg: #{$ouds-color-surface-secondary};
--#{$prefix}alert-border-color: #{$ouds-color-border-default};
}

//// Additional content
.alert * p {
margin: 0;
.alert-accent {
--#{$prefix}alert-icon-color: #{$ouds-color-content-status-accent};
--#{$prefix}alert-bg: #{$ouds-color-surface-status-accent-muted};
--#{$prefix}alert-border-color: #{$ouds-color-border-status-accent};
}

.alert-heading ~ p {
line-height: 1.5;
.alert-negative {
--#{$prefix}alert-icon: var(--#{$prefix}error-icon);
--#{$prefix}alert-icon-color: #{$ouds-color-content-status-negative};
--#{$prefix}alert-bg: #{$ouds-color-surface-status-negative-muted};
--#{$prefix}alert-border-color: #{$ouds-color-border-status-negative};
}

//// Icons
.alert-icon {
flex-shrink: 0;
width: var(--#{$prefix}alert-icon-size);
margin: calc(-.5 * var(--#{$prefix}alert-icon-margin-y)) 0;
.alert-positive {
--#{$prefix}alert-icon: var(--#{$prefix}success-icon);
--#{$prefix}alert-icon-color: #{$ouds-color-content-status-positive};
--#{$prefix}alert-bg: #{$ouds-color-surface-status-positive-muted};
--#{$prefix}alert-border-color: #{$ouds-color-border-status-positive};
}

+ * {
margin: var(--#{$prefix}alert-icon-margin-y) 0 0;
.alert-info {
--#{$prefix}alert-icon: var(--#{$prefix}info-icon);
--#{$prefix}alert-icon-color: #{$ouds-color-content-status-info};
--#{$prefix}alert-bg: #{$ouds-color-surface-status-info-muted};
--#{$prefix}alert-border-color: #{$ouds-color-border-status-info};
}

.alert-warning {
--#{$prefix}alert-icon: var(--#{$prefix}warning-icon);
--#{$prefix}alert-icon-color: var(--#{$prefix}icon-color-content-status-warning-external-shape);
--#{$prefix}alert-icon-internal: var(--#{$prefix}warning-internal-icon);
--#{$prefix}alert-icon-internal-color: var(--#{$prefix}icon-color-content-status-warning-internal-shape);
--#{$prefix}alert-bg: #{$ouds-color-surface-status-warning-muted};
--#{$prefix}alert-border-color: #{$ouds-color-border-status-warning};
}

@if $enable-bootstrap-compatibility {
.alert {
> svg,
> img,
> .icon {
@extend .alert-icon;
fill: currentcolor;
}
}

+ p {
font-weight: var(--#{$prefix}alert-heading-font-weight);
.alert-danger {
@extend .alert-negative;
}

&::before {
display: block;
order: -1;
height: var(--#{$prefix}alert-logo-size);
content: "";
background-color: var(--#{$prefix}alert-border-color);
mask-image: var(--#{$prefix}alert-icon-bg-image);
mask-repeat: no-repeat;

/* rtl:raw:
mask-position: top right;
*/
mask-size: var(--#{$prefix}alert-logo-size);
.alert-success {
@extend .alert-positive;
}

.alert-primary {
@extend .alert-accent;
}

.alert-secondary,
.alert-light,
.alert-dark {
@extend .alert-neutral;
}
}

//// Small alerts
.alert-sm {
// scss-docs-start alert-sm-css-vars
--#{$prefix}alert-padding-x: 0;
--#{$prefix}alert-padding-y: #{$alert-padding-sm};
--#{$prefix}alert-margin-bottom: 0;
@include rfs($font-size-sm, --#{$prefix}alert-font-size);
--#{$prefix}alert-line-height: #{$line-height-sm};
--#{$prefix}alert-border: 0;
--#{$prefix}alert-logo-size: #{$alert-logo-size-sm};
--#{$prefix}alert-icon-size: #{$alert-icon-size-sm};
--#{$prefix}alert-btn-close-offset: #{$alert-btn-close-offset-sm};
// scss-docs-end alert-sm-css-vars
--#{$prefix}icon-spacing: #{$btn-close-padding-sm};

.alert-icon {
margin: var(--#{$prefix}alert-icon-margin-y) 0;
.alert-heading {
@extend .alert-label;
}
}
// End mod
2 changes: 0 additions & 2 deletions scss/_maps.scss
Original file line number Diff line number Diff line change
Expand Up @@ -436,5 +436,3 @@ $gutters: $ouds-dimension-space-fixed !default; // instead of `$spacers`
$gutters: map-merge($gutters, $spacers);
}
// End mod

$alert-colors: map-remove($theme-colors, "primary", "secondary", "light", "dark") !default; // OUDS mod
Loading
Loading