Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(notification): Colouring the exclamation mark in the warning icon in EC - FRONT-4249 #3227

Merged
merged 2 commits into from Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -427,6 +427,9 @@ exports[`EC Notification Warning renders correctly 1`] = `
data-ecl-notification=""
role="alert"
>
<span
class="ecl-notification__icon-background"
/>
<svg
aria-hidden="true"
class="ecl-icon ecl-icon--l ecl-notification__icon"
Expand Down Expand Up @@ -907,6 +910,9 @@ exports[`EU Notification Warning renders correctly 1`] = `
data-ecl-notification=""
role="alert"
>
<span
class="ecl-notification__icon-background"
/>
<svg
aria-hidden="true"
class="ecl-icon ecl-icon--m ecl-notification__icon"
Expand Down
Expand Up @@ -48,11 +48,13 @@
{# Print the result #}

<div class="{{ _css_class }}" data-ecl-notification role="alert"{{ _extra_attributes|raw }}>
{% if _variant == 'warning' and _icon is not empty and _icon.name is defined and _icon.name == 'warning' %}
<span class="ecl-notification__icon-background"></span>
{% endif %}
{% include '@ecl/icon/icon.html.twig' with {
icon: _icon,
extra_classes: 'ecl-notification__icon',
} only %}

<div class="ecl-notification__content">
{% if _close is not empty %}
{% include '@ecl/button/button.html.twig' with _close|merge({
Expand Down
Expand Up @@ -19,6 +19,9 @@ exports[`eTrans EC renders correctly with languages list 1`] = `
data-ecl-notification=""
role="alert"
>
<span
class="ecl-notification__icon-background"
/>
<svg
aria-hidden="true"
class="ecl-icon ecl-icon--l ecl-notification__icon"
Expand Down Expand Up @@ -395,6 +398,9 @@ exports[`eTrans EC renders correctly without languages list 1`] = `
data-ecl-notification=""
role="alert"
>
<span
class="ecl-notification__icon-background"
/>
<svg
aria-hidden="true"
class="ecl-icon ecl-icon--l ecl-notification__icon"
Expand Down Expand Up @@ -478,6 +484,9 @@ exports[`eTrans EU renders correctly with languages list 1`] = `
data-ecl-notification=""
role="alert"
>
<span
class="ecl-notification__icon-background"
/>
<svg
aria-hidden="true"
class="ecl-icon ecl-icon--l ecl-notification__icon"
Expand Down Expand Up @@ -852,6 +861,9 @@ exports[`eTrans EU renders correctly without languages list 1`] = `
data-ecl-notification=""
role="alert"
>
<span
class="ecl-notification__icon-background"
/>
<svg
aria-hidden="true"
class="ecl-icon ecl-icon--l ecl-notification__icon"
Expand Down
Expand Up @@ -102,6 +102,18 @@ $notification: null !default;

.ecl-notification__icon {
fill: map.get($notification, 'warning', 'color');
position: relative;
z-index: 2;
}

.ecl-notification__icon-background {
background: map.get($notification, 'warning', 'icon-background-color');
height: map.get($notification, 'warning', 'icon-background-height');
left: map.get($notification, 'warning', 'icon-background-left');
position: absolute;
width: var(--s-xs);
top: map.get($notification, 'warning', 'icon-background-top');
z-index: 1;
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/themes/ec/variables/_notification.scss
Expand Up @@ -24,6 +24,10 @@ $notification: (
warning: (
background: var(--c-n-20),
color: var(--c-wa),
icon-background-color: var(--c-d),
icon-background-height: var(--s-m),
icon-background-top: 35px,
icon-background-left: 36px,
),
error: (
background: var(--c-n-20),
Expand Down
4 changes: 4 additions & 0 deletions src/themes/eu/variables/_notification.scss
Expand Up @@ -25,6 +25,10 @@ $notification: (
warning: (
background: var(--c-wa-5),
color: var(--c-wa),
icon-background-color: transparent,
icon-background-height: var(--s-s),
icon-background-top: var(--s-xl),
icon-background-left: var(--s-xl),
),
error: (
background: var(--c-er-5),
Expand Down