alerts.less 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. .alert-info-alt {
  59. .alert-variant(@alert-info-alt-bg; @alert-info-alt-border; @alert-info-alt-text);
  60. }
  61. .btn-alert-info {
  62. .button-variant(@btn-info-color; @btn-info-bg; @btn-info-border);
  63. .alert-btn(@btn-info-bg);
  64. }
  65. .alert-warning {
  66. .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text);
  67. }
  68. .btn-alert-warning {
  69. .btn-alert-variant(@alert-warning-bg);
  70. }
  71. .alert-danger {
  72. .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text);
  73. }
  74. .btn-alert-danger {
  75. .btn-alert-variant(@alert-danger-bg);
  76. }
  77. .alert-alt {
  78. .alert-variant(@alert-alt-bg; @alert-alt-border; @alert-alt-text);
  79. }
  80. .btn-alert-alt {
  81. .btn-alert-variant(@alert-alt-bg);
  82. }
  83. .alert {
  84. a,
  85. .btn-inline-link {
  86. color: white;
  87. text-decoration: underline;
  88. background: none;
  89. &:hover,
  90. &:focus,
  91. &:active {
  92. background: none;
  93. }
  94. }
  95. .btn:not(.btn-inline-link) {
  96. text-decoration: none;
  97. }
  98. }