styles.scss 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /* =============================================================================
  2. /* Wagtail CMS main stylesheet
  3. /* =============================================================================
  4. REFERENCE
  5. * We organize our styles based on a combination of ITCSS and
  6. the Sass 7-1 pattern.
  7. * Classes should be written using BEM, which we modify to include a prefix.
  8. * Every BEM block should have its own file.
  9. ┌────────────┬────────────────────────┬──────────────┬────────┐
  10. │ Folder │ Contents │ ITCSS level │ Prefix │
  11. ├────────────┼────────────────────────┼──────────────┼────────┤
  12. │ settings │ variables, maps, fonts │ 1 Settings │ │
  13. │ tools │ mixins, functions │ 2 Tools │ │
  14. │ generic │ resets │ 3 Generic │ │
  15. │ elements │ elements, no classes │ 4 Elements │ │
  16. │ objects │ classes │ 5 Objects │ o- │
  17. │ │ layout │ │ │
  18. │ components │ classes │ 6 Components │ c- │
  19. │ │ BEM blocks │ │ │
  20. │ overrides │ classes │ 7 Trumps │ u- │
  21. │ │ overrides, utilities │ │ │
  22. └────────────┴────────────────────────┴──────────────┴────────┘
  23. SCSS: https://sass-lang.com/guide
  24. ITCSS: https://www.creativebloq.com/web-design/manage-large-css-projects-itcss-101517528
  25. Sass 7-1 pattern: https://gist.github.com/rveitch/84cea9650092119527bc
  26. BEM: http://getbem.com/
  27. OTHER PREFIXES
  28. ┌────────┬─────────┐
  29. │ Prefix │ Purpose │
  30. ├────────┼─────────┤
  31. │ t- │ theme │
  32. │ is- │ state │
  33. └────────┴─────────┘
  34. ==============================================================================*/
  35. /* SETTINGS
  36. These are variables, maps, and fonts.
  37. * No CSS should be produced by these files
  38. */
  39. @import 'settings';
  40. /* TOOLS
  41. These are functions and mixins.
  42. * No CSS should be produced by these files.
  43. */
  44. @import 'tools';
  45. /* GENERIC
  46. This is for resets and other rules that affect large collections of bare elements.
  47. * Changes to them should be very rare.
  48. */
  49. // @import 'generic/generic';
  50. /* ELEMENTS
  51. These are base styles for bare HTML elements.
  52. * Changes to them should be very rare.
  53. */
  54. @import 'elements/elements';
  55. @import 'elements/typography';
  56. @import 'elements/forms';
  57. /* OBJECTS
  58. These are classes related to layout, known as 'objects' in ITCSS or OOCSS.
  59. * This is for grids, wrappers, and other non-consmetic layout utilities.
  60. * These classes are prefixed with `.o-`.
  61. */
  62. @import 'objects/objects';
  63. @import 'objects/avatar';
  64. /* COMPONENTS
  65. These are classes for components.
  66. * These classes (unless legacy) are prefixed with `.c-`.
  67. * React component styles live in the same folders as their React components,
  68. which is the preferred pattern over housing them in the scss folder.
  69. */
  70. @import '../src/components/Transition/Transition';
  71. @import '../src/components/LoadingSpinner/LoadingSpinner';
  72. @import '../src/components/PublicationStatus/PublicationStatus';
  73. @import '../src/components/Explorer/Explorer';
  74. // Legacy
  75. @import 'components/icons';
  76. @import 'components/tabs';
  77. @import 'components/dropdown';
  78. @import 'components/dropdown.legacy';
  79. @import 'components/help-block';
  80. @import 'components/modals';
  81. @import 'components/forms';
  82. @import 'components/button';
  83. @import 'components/chooser';
  84. @import 'components/tag';
  85. @import 'components/listing';
  86. @import 'components/messages';
  87. @import 'components/messages.capability';
  88. @import 'components/messages.status';
  89. @import 'components/header';
  90. @import 'components/progressbar';
  91. @import 'components/main-nav';
  92. @import 'components/indicator';
  93. @import 'components/tooltips';
  94. @import 'components/logo';
  95. @import 'components/grid.legacy';
  96. @import 'components/breadcrumb';
  97. @import 'components/footer';
  98. @import 'components/loading-mask';
  99. @import 'components/media-placeholder';
  100. @import 'components/human-readable-date';
  101. @import 'components/link.legacy';
  102. @import 'components/privacy-indicator';
  103. @import 'components/status-tag';
  104. @import 'components/button-select';
  105. @import 'components/skiplink';
  106. @import 'components/workflow-tasks';
  107. /* OVERRIDES
  108. These are classes that provide overrides.
  109. * Higher specificity is allowed here because these are overrides and imported last.
  110. */
  111. // VENDOR: overrides of vendor styles.
  112. @import 'overrides/vendor.datetimepicker';
  113. @import 'overrides/vendor.tagit';
  114. // UTILITIES: classes that do one simple thing.
  115. @import 'overrides/utilities.hidden';
  116. @import 'overrides/utilities.text';
  117. @import 'overrides/utilities.dropdowns';
  118. @import 'overrides/utilities.focus';
  119. @import 'overrides/utilities.visuallyhidden';
  120. // Legacy utilities
  121. @import 'overrides/utilities.text.legacy';
  122. @import 'overrides/utilities.legacy';
  123. // PAGES: page-specific overrides
  124. @import 'overrides/pages.homepage';
  125. @import 'overrides/pages.page-explorer';