2
0

_alerts.scss 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. .alert {
  2. // scss-docs-start alert-variables
  3. --#{$prefix}alert-color: var(--#{$prefix}body-color);
  4. --#{$prefix}alert-bg: #{color-transparent(var(--#{$prefix}alert-color), .1)};
  5. --#{$prefix}alert-padding-x: #{$alert-padding-x};
  6. --#{$prefix}alert-padding-y: #{$alert-padding-y};
  7. --#{$prefix}alert-margin-bottom: #{$alert-margin-bottom};
  8. --#{$prefix}alert-border-color: #{color-transparent(var(--#{$prefix}alert-color), .2)};
  9. --#{$prefix}alert-border: var(--#{$prefix}border-width) solid var(--#{$prefix}alert-border-color);
  10. --#{$prefix}alert-border-radius: var(--#{$prefix}border-radius);
  11. --#{$prefix}alert-link-color: inherit;
  12. --#{$prefix}alert-heading-font-weight: var(--#{$prefix}font-weight-medium);
  13. // scss-docs-end
  14. position: relative;
  15. padding: var(--#{$prefix}alert-padding-y) var(--#{$prefix}alert-padding-x);
  16. margin-bottom: var(--#{$prefix}alert-margin-bottom);
  17. background-color: color-mix(in srgb, var(--#{$prefix}alert-bg), var(--#{$prefix}bg-surface));
  18. border-radius: var(--#{$prefix}alert-border-radius);
  19. border: var(--#{$prefix}border-width) var(--#{$prefix}border-style) var(--#{$prefix}alert-border-color);
  20. display: flex;
  21. flex-direction: row;
  22. gap: 1rem;
  23. }
  24. .alert-heading {
  25. color: inherit;
  26. margin-bottom: .25rem; // todo: use variable
  27. font-weight: var(--#{$prefix}alert-heading-font-weight);
  28. }
  29. .alert-description {
  30. color: var(--#{$prefix}secondary);
  31. }
  32. .alert-icon {
  33. color: var(--#{$prefix}alert-color);
  34. width: 1.25rem !important; // todo: use variable
  35. height: 1.25rem !important;
  36. }
  37. .alert-action {
  38. color: var(--#{$prefix}alert-color);
  39. text-decoration: underline;
  40. &:hover {
  41. text-decoration: none;
  42. }
  43. }
  44. .alert-list {
  45. margin: 0;
  46. }
  47. .alert-link {
  48. font-weight: $alert-link-font-weight;
  49. color: var(--#{$prefix}alert-link-color);
  50. &,
  51. &:hover {
  52. color: var(--#{$prefix}alert-color);
  53. }
  54. }
  55. .alert-dismissible {
  56. padding-right: 3rem; //todo: use variable
  57. .btn-close {
  58. position: absolute;
  59. top: calc(var(--#{$prefix}alert-padding-x) / 2 - 1px);
  60. right: calc(var(--#{$prefix}alert-padding-y) / 2 - 1px);
  61. z-index: 1;
  62. padding: calc(var(--#{$prefix}alert-padding-y) * 1.25) var(--#{$prefix}alert-padding-x);
  63. }
  64. }
  65. .alert-important {
  66. border-color: var(--#{$prefix}alert-color);
  67. background-color: var(--#{$prefix}alert-color);
  68. color: var(--#{$prefix}white);
  69. .alert-description {
  70. color: inherit;
  71. }
  72. .alert-icon {
  73. color: inherit;
  74. }
  75. }
  76. .alert-minor {
  77. background: transparent;
  78. border-color: var(--tblr-border-color);
  79. }
  80. @each $name, $color in $theme-colors {
  81. .alert-#{$name} {
  82. --#{$prefix}alert-color: var(--#{$prefix}#{$name});
  83. }
  84. }