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: alert color variants #940

Merged
merged 4 commits into from
Jul 20, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/componenti/alert.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gli avvisi sono disponibili in quattro tipologie diverse e sono adatti a qualsia

{% comment %}Example name: Varianti per tipologia{% endcomment %}
{% capture example %}
{% assign colors = "info,success,warning,danger" | split: ','%}
{% assign colors = "primary,info,success,warning,danger" | split: ','%}
{% for color in colors %}

<div class="alert alert-{{color}}" role="alert">
Expand Down
5 changes: 4 additions & 1 deletion src/scss/custom/_alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
// Generate contextual modifier classes for colorizing the alert.

@each $color, $value in $theme-colors {
@if ($color == 'danger' or $color == 'warning' or $color == 'success' or $color == 'info') {
@if ($color == 'danger' or $color == 'warning' or $color == 'success' or $color == 'info' or $color == 'primary') {
.alert-#{$color} {
background-position: 20px 16px;
background-repeat: no-repeat;
Expand All @@ -68,3 +68,6 @@
.alert-info {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='#{url-friendly-color($info)}' d='M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 19a9 9 0 1 1 9-9 9 9 0 0 1-9 9zm-.7-15h1.5v2h-1.5zm0 3h1.5v9h-1.5z'%3E%3C/path%3E%3C/svg%3E");
}
.alert-primary {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='#{url-friendly-color($primary)}' d='M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 19a9 9 0 1 1 9-9 9 9 0 0 1-9 9zm-.7-15h1.5v2h-1.5zm0 3h1.5v9h-1.5z'%3E%3C/path%3E%3C/svg%3E");
}
Loading