alerts.less 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // Alerts
  3. // --------------------------------------------------
  4. // Base styles
  5. // -------------------------
  6. .alert {
  7. padding: @alert-padding;
  8. margin-bottom: @line-height-computed;
  9. border: 1px solid transparent;
  10. border-radius: @alert-border-radius;
  11. // Headings for larger alerts
  12. h4 {
  13. margin-top: 0;
  14. color: inherit; // Specified for the h4 to prevent conflicts of changing @headings-color
  15. }
  16. // Provide class for links that match alerts
  17. .alert-link {
  18. font-weight: @alert-link-font-weight;
  19. }
  20. // Improve alignment and spacing of inner content
  21. > p,
  22. > ul {
  23. margin-bottom: 0;
  24. }
  25. > p + p {
  26. margin-top: 5px;
  27. }
  28. }
  29. // Dismissible alerts
  30. //
  31. // Expand the right padding and account for the close button's positioning.
  32. // The misspelled .alert-dismissable was deprecated in 3.2.0.
  33. .alert-dismissable,
  34. .alert-dismissible {
  35. padding-right: (@alert-padding + 20);
  36. // Adjust close link position
  37. .close {
  38. position: relative;
  39. top: -2px;
  40. right: -21px;
  41. color: inherit;
  42. }
  43. }
  44. // Alternate styles
  45. //
  46. // Generate contextual modifier classes for colorizing the alert.
  47. .alert-success {
  48. .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text);
  49. }
  50. .alert-info {
  51. .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text);
  52. }
  53. .alert-warning {
  54. .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text);
  55. }
  56. .alert-danger {
  57. .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text);
  58. }