<div class="vgr-alert vgr-mt-1 vgr-alert--success">
<div class="vgr-alert__icon">
<svg class="vgr-icon vgr-icon--"><use xlink:href="/icons/sprite/icons.svg#message--success"></use></svg>
</div>
<div class="vgr-alert__content">
<h2 class="vgr-alert__title">Success message</h2>
<div class="vgr-alert__description">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.</p>
</div>
</div>
</div>
<div class="vgr-alert vgr-mt-1 vgr-alert--{{ modifier }}">
{% if icon %}
<div class="vgr-alert__icon">
{% render "@icon", iconData %}
</div>
{% endif %}
<div class="vgr-alert__content">
<h2 class="vgr-alert__title">{{ title }}</h2>
<div class="vgr-alert__description">
{{ description }}
</div>
</div>
</div>
{
"title": "Success message",
"modifier": "success",
"description": "<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.</p>",
"icon": true,
"iconData": {
"id": "message--success"
}
}
.vgr-alert {
padding: $default-whitespace;
font-family: $secondary-font-stack;
display: flex;
flex-direction: row;
align-items: center;
a {
color: inherit;
}
&__title {
display: block;
margin: 0;
font-size: 1rem;
}
&__description {
*:first-child {
margin-top: 0;
}
*:last-child {
margin-bottom: 0;
}
}
&--default {
background-color: $color-success;
color: darken($color-success, 60%);
}
&--success {
background-color: $color-success;
color: darken($color-success, 60%);
}
&--warning {
background-color: $color-warning;
color: darken($color-warning, 70%);
}
&--error {
background-color: $color-error;
color: darken($color-error, 60%);
}
&--info {
background-color: $color-info;
color: darken($color-info, 60%);
}
&__icon {
margin-right: $default-whitespace;
fill: currentColor;
}
.vgr-icon {
width: 2.75rem;
height: 2.75rem;
}
}
Text from The U.S. Web Design Standards
role="alert"
to inform assistive technologies of a time-sensitive and important message that is not interactive. If the message is interactive, use the alertdialog
role instead.