Add new alert icons (#2226)

This commit is contained in:
Richard Schreiber
2021-10-06 12:31:08 +02:00
committed by GitHub
parent bc7300c393
commit 65167cc290
2 changed files with 19 additions and 23 deletions

View File

@@ -129,48 +129,40 @@ input[type=number]::-webkit-outer-spin-button {
padding-left: 65px;
&::before {
color: white;
content: "";
position: absolute;
display: block;
left: 0;
top: 0;
width: 50px;
padding-top: 13px;
text-align: center;
width: 51px;
height: 100%;
font: normal normal normal 14px FontAwesome;
font-size: 24px;
text-rendering: auto; // optimizelegibility throws things off #1094
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
background-repeat: no-repeat;
background-position: 6px 6px;
background-size: 38px 38px;
}
}
.sr-only.alert::before {
background: none !important;
}
.alert-success::before {
background: $state-success-border;
content: "\f00c";
background-color: $state-success-border;
background-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2036%2036'%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%3E%3Crect%20x='5'%20y='5'%20width='26'%20height='26'%20fill='%23fff'/%3E%3Cpath%20d='M25.57%2014.65c0-.23-.1-.46-.26-.62l-1.24-1.24a.89.89%200%200%200-1.24%200l-5.98%206-2.68-2.7a.89.89%200%200%200-1.24%200l-1.24%201.24a.88.88%200%200%200%200%201.24l4.54%204.54a.88.88%200%200%200%201.24%200l7.84-7.84c.17-.16.26-.4.26-.62Z'%20fill='#{url-friendly-colour($state-success-text)}'/%3E%3C/svg%3E%0A");
}
.alert-info::before {
background: $state-info-border;
content: "\f129";
background-color: $state-info-border;
background-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2036%2036'%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%3E%3Ccircle%20cx='18'%20cy='18'%20r='16'%20fill='%23fff'/%3E%3Cpath%20d='M21.74%2022.66a.7.7%200%200%200-.7-.7h-.7v-6.28a.7.7%200%200%200-.7-.7h-4.19a.7.7%200%200%200-.7.7v1.4c0%20.38.32.7.7.7h.7v4.19h-.7a.7.7%200%200%200-.7.7v1.4c0%20.37.32.7.7.7h5.6a.7.7%200%200%200%20.69-.7v-1.4Zm-1.4-12.57a.7.7%200%200%200-.7-.7h-2.8a.7.7%200%200%200-.69.7v2.1c0%20.38.32.7.7.7h2.8a.7.7%200%200%200%20.7-.7v-2.1Z'%20fill='#{url-friendly-colour($state-info-text)}'/%3E%3C/svg%3E%0A");
}
.alert-warning::before {
background: $state-warning-border;
content: "\f071";
font-size: 22px;
padding-top: 14px;
background-color: $state-warning-border;
background-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2036%2036'%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%3E%3Cpath%20d='M20.04%202.89a2.2%202.2%200%200%200-3.87%200L2.88%2027.24a2.22%202.22%200%200%200%201.94%203.27h26.57a2.22%202.22%200%200%200%201.94-3.27L20.04%202.89Z'%20fill='%23fff'/%3E%3Cpath%20d='M19.92%2025.22c0%20.26-.2.47-.45.47h-2.73a.46.46%200%200%201-.45-.47v-2.7c0-.25.2-.46.45-.46h2.73c.25%200%20.45.21.45.47v2.7Zm-.02-5.31c-.02.19-.24.33-.5.33h-2.62c-.27%200-.48-.14-.48-.33l-.24-6.48c0-.09.04-.23.14-.3.09-.07.21-.16.34-.16h3.12c.13%200%20.26.09.35.16.1.07.14.18.14.27l-.26%206.51Z'%20fill='#{url-friendly-colour($state-warning-text)}'/%3E%3C/svg%3E");
}
.alert-legal::before {
background: $state-info-border;
content: "\f0e3";
background-color: $state-info-border;
background-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2036%2036'%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%3E%3Ccircle%20cx='18'%20cy='18'%20r='16'%20fill='%23fff'/%3E%3Cpath%20d='M19.41%2011.55c0-.43.2-.79.58-1.08-.42-.27-.99-.4-1.7-.4-.62%200-1.1.13-1.46.4-.36.26-.54.62-.54%201.08%200%20.42.13.76.38%201.01.18.15.5.33.95.57l1.77.85c1.04.48%201.79.9%202.25%201.25.51.36.88.8%201.1%201.3h-.02c.18.38.27.76.27%201.14%200%201.1-.62%202.18-1.85%203.22.48.46.81.9%201%201.3a3.84%203.84%200%200%201-.05%203.07c-.22.5-.54.91-.95%201.26-.42.34-.92.61-1.5.8a6.45%206.45%200%200%201-3.91%200%205.44%205.44%200%200%201-1.6-.79%203.67%203.67%200%200%201-1.1-1.22%203.11%203.11%200%200%201-.36-1.5c0-.66.17-1.2.52-1.59.36-.39.83-.59%201.42-.59.46%200%20.87.16%201.22.48.36.32.53.7.53%201.16%200%20.56-.33%201.03-1%201.41.03.05.07.1.13.13l.2.16a3.24%203.24%200%200%200%201.9.53c.67%200%201.2-.15%201.6-.46.38-.3.58-.7.58-1.22%200-.37-.13-.69-.38-.96a4.46%204.46%200%200%200-1.16-.82l-.9-.44A24.66%2024.66%200%200%201%2015%2020.44a7.7%207.7%200%200%201-.9-.6c-.86-.73-1.29-1.54-1.29-2.45%200-1.16.62-2.23%201.87-3.22a4.7%204.7%200%200%201-.79-1.16%203.38%203.38%200%200%201%20.95-3.98A5.02%205.02%200%200%201%2018.14%208c1.3%200%202.37.3%203.21.91V8.9c.92.6%201.37%201.38%201.37%202.33%200%20.51-.16.93-.49%201.27-.33.34-.75.5-1.26.5a1.6%201.6%200%200%201-1.12-.4c-.3-.28-.44-.62-.44-1.04Zm-1.27%204.66a26.2%2026.2%200%200%201-1.73-.84c-.6.6-.89%201.13-.89%201.6%200%20.34.13.63.39.87.17.15.42.31.74.5a30.57%2030.57%200%200%200%201.93%201l.85.45c.58-.58.87-1.14.87-1.68%200-.36-.15-.67-.46-.94-.3-.27-.87-.6-1.7-.96Z'%20fill='#{url-friendly-colour($state-info-text)}'/%3E%3C/svg%3E");
}
.alert-danger::before {
background: $state-danger-border;
content: "\f071";
font-size: 22px;
padding-top: 14px;
background-color: $state-danger-border;
background-image: url("data:image/svg+xml,%3Csvg%20viewBox='0%200%2036%2036'%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%3E%3Cpath%20d='M12.14%204.62h11.64l8.24%208.24V23.4l-8.24%208.24H12.14L3.9%2023.39V12.86l8.24-8.24Z'%20fill='%23fff'/%3E%3Cpath%20d='M24.74%2022.6c0-.28-.11-.56-.31-.76l-3.27-3.27%203.27-3.27a1.08%201.08%200%200%200%200-1.52l-1.51-1.5a1.08%201.08%200%200%200-1.52%200l-3.27%203.26-3.27-3.27a1.08%201.08%200%200%200-1.52%200l-1.5%201.51a1.08%201.08%200%200%200%200%201.52l3.26%203.27-3.27%203.27a1.08%201.08%200%200%200%200%201.52l1.51%201.51a1.08%201.08%200%200%200%201.52%200l3.27-3.27%203.27%203.27a1.08%201.08%200%200%200%201.52%200l1.51-1.51c.2-.2.31-.48.31-.76Z'%20fill='#{url-friendly-colour($state-danger-text)}'/%3E%3C/svg%3E%0A");
}
.alert-primary::before {
background: $brand-primary !important;

View File

@@ -6,6 +6,10 @@
@return mix(black, $color, $percentage);
}
@function url-friendly-colour($colour) {
@return '%23' + str-slice('#{$colour}', 2, -1)
}
$gray-darker: lighten(#000, 13.5%);
$gray-dark: lighten(#000, 20%);
$gray: lighten(#000, 33.5%);