alerts.less 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. //
  2. // Alerts
  3. // --------------------------------------------------
  4. // Base styles
  5. // -------------------------
  6. .alert {
  7. padding: @alert-padding;
  8. margin-bottom: @line-height-computed;
  9. border-left: 3px solid transparent;
  10. border-radius: @alert-border-radius;
  11. // Headings for larger alerts
  12. h4 {
  13. margin-top: 0;
  14. // Specified for the h4 to prevent conflicts of changing @headings-color
  15. color: inherit;
  16. }
  17. // Provide class for links that match alerts
  18. .alert-link {
  19. font-weight: @alert-link-font-weight;
  20. }
  21. // Improve alignment and spacing of inner content
  22. > p,
  23. > ul {
  24. margin-bottom: 0;
  25. }
  26. > p + p {
  27. margin-top: 5px;
  28. }
  29. p:last-child {
  30. margin-bottom: 0;
  31. }
  32. }
  33. // Dismissable alerts
  34. //
  35. // Expand the right padding and account for the close button's positioning.
  36. .alert-dismissable {
  37. padding-right: (@alert-padding + 20);
  38. // Adjust close link position
  39. .close {
  40. position: relative;
  41. top: -2px;
  42. right: -21px;
  43. color: inherit;
  44. }
  45. }
  46. // Alternate styles
  47. //
  48. // Generate contextual modifier classes for colorizing the alert.
  49. .alert-success {
  50. .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text);
  51. }
  52. .btn-alert-success {
  53. .btn-alert-variant(@alert-success-bg);
  54. }
  55. .alert-info {
  56. .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text);
  57. }
  58. .btn-alert-info {
  59. .button-variant(@btn-info-color; @btn-info-bg; @btn-info-border);
  60. .alert-btn(@btn-info-bg);
  61. }
  62. .alert-warning {
  63. .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text);
  64. }
  65. .btn-alert-warning {
  66. .btn-alert-variant(@alert-warning-bg);
  67. }
  68. .alert-danger {
  69. .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text);
  70. }
  71. .btn-alert-danger {
  72. .btn-alert-variant(@alert-danger-bg);
  73. }
  74. .alert-alt {
  75. .alert-variant(@alert-alt-bg; @alert-alt-border; @alert-alt-text);
  76. }
  77. .btn-alert-alt {
  78. .btn-alert-variant(@alert-alt-bg);
  79. }
  80. .alert {
  81. a,
  82. .btn-inline-link {
  83. color: white;
  84. text-decoration: underline;
  85. background: none;
  86. &:hover,
  87. &:focus,
  88. &:active {
  89. background: none;
  90. }
  91. }
  92. .btn:not(.btn-inline-link) {
  93. text-decoration: none;
  94. }
  95. }