layout.css

Stark layout method

To avoid obscuring CSS added to the page by Drupal or a contrib module, the Stark theme itself has no styling, except just enough CSS to arrange the page in a traditional "Header, sidebars, content, and footer" layout.

This layout method works reasonably well, but shouldn't be used on a production site because it can break. For example, if an over-large image (one that is wider than 20% of the viewport) is in the left sidebar, the image will overlap with the #content to the right.

File

drupal/core/themes/stark/css/layout.css
View source
  1. /**
  2. * @file
  3. * Stark layout method
  4. *
  5. * To avoid obscuring CSS added to the page by Drupal or a contrib module, the
  6. * Stark theme itself has no styling, except just enough CSS to arrange the page
  7. * in a traditional "Header, sidebars, content, and footer" layout.
  8. *
  9. * This layout method works reasonably well, but shouldn't be used on a
  10. * production site because it can break. For example, if an over-large image
  11. * (one that is wider than 20% of the viewport) is in the left sidebar, the
  12. * image will overlap with the #content to the right.
  13. */
  14. #content,
  15. #sidebar-first,
  16. #sidebar-second {
  17. display: inline;
  18. position: relative;
  19. }
  20. img {
  21. height: auto;
  22. max-width: 100%;
  23. }
  24. @media all and (min-width: 480px) and (max-width: 959px) {
  25. #content {
  26. width: 100%;
  27. }
  28. body.sidebar-first #content,
  29. body.two-sidebars #content {
  30. width: 67%;
  31. float: right; /* LTR */
  32. }
  33. body.sidebar-second #content {
  34. width: 67%;
  35. float: left; /* LTR */
  36. }
  37. #sidebar-first {
  38. width: 33%;
  39. float: left; /* LTR */
  40. }
  41. #sidebar-second {
  42. width: 33%;
  43. float: right; /* LTR */
  44. }
  45. body.two-sidebars #sidebar-second {
  46. clear: both;
  47. width: 100%;
  48. }
  49. body.two-sidebars #sidebar-second .block {
  50. float: left; /* LTR */
  51. width: 33%;
  52. }
  53. body.two-sidebars #sidebar-second .block:nth-child(3n+1) {
  54. clear: both;
  55. }
  56. }
  57. @media all and (min-width: 960px) {
  58. #content {
  59. width: 100%;
  60. float: left; /* LTR */
  61. }
  62. body.sidebar-first #content {
  63. width: 80%;
  64. left: 20%; /* LTR */
  65. }
  66. body.sidebar-second #content {
  67. width: 80%;
  68. }
  69. body.two-sidebars #content {
  70. width: 60%;
  71. left: 20%; /* LTR */
  72. }
  73. #sidebar-first {
  74. width: 20%;
  75. float: left; /* LTR */
  76. left: -80%; /* LTR */
  77. }
  78. body.two-sidebars #sidebar-first {
  79. left: -60%; /* LTR */
  80. }
  81. #sidebar-second {
  82. float: right; /* LTR */
  83. width: 20%;
  84. }
  85. }
  86. /**
  87. * Responsive tables.
  88. */
  89. @media screen and (max-width:28.125em) { /* 450px */
  90. th.priority-low,
  91. td.priority-low,
  92. th.priority-medium,
  93. td.priority-medium {
  94. display: none;
  95. }
  96. }
  97. @media screen and (max-width:45em) { /* 720px */
  98. th.priority-low,
  99. td.priority-low {
  100. display: none;
  101. }
  102. }