You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

200 lines
2.8 KiB

2 months ago
  1. // Styles for GoogleTest docs website on GitHub Pages.
  2. // Color variables are defined in
  3. // https://github.com/pages-themes/primer/tree/master/_sass/primer-support/lib/variables
  4. $sidebar-width: 260px;
  5. body {
  6. display: flex;
  7. margin: 0;
  8. }
  9. .sidebar {
  10. background: $black;
  11. color: $text-white;
  12. flex-shrink: 0;
  13. height: 100vh;
  14. overflow: auto;
  15. position: sticky;
  16. top: 0;
  17. width: $sidebar-width;
  18. }
  19. .sidebar h1 {
  20. font-size: 1.5em;
  21. }
  22. .sidebar h2 {
  23. color: $gray-light;
  24. font-size: 0.8em;
  25. font-weight: normal;
  26. margin-bottom: 0.8em;
  27. padding-left: 2.5em;
  28. text-transform: uppercase;
  29. }
  30. .sidebar .header {
  31. background: $black;
  32. padding: 2em;
  33. position: sticky;
  34. top: 0;
  35. width: 100%;
  36. }
  37. .sidebar .header a {
  38. color: $text-white;
  39. text-decoration: none;
  40. }
  41. .sidebar .nav-toggle {
  42. display: none;
  43. }
  44. .sidebar .expander {
  45. cursor: pointer;
  46. display: none;
  47. height: 3em;
  48. position: absolute;
  49. right: 1em;
  50. top: 1.5em;
  51. width: 3em;
  52. }
  53. .sidebar .expander .arrow {
  54. border: solid $white;
  55. border-width: 0 3px 3px 0;
  56. display: block;
  57. height: 0.7em;
  58. margin: 1em auto;
  59. transform: rotate(45deg);
  60. transition: transform 0.5s;
  61. width: 0.7em;
  62. }
  63. .sidebar nav {
  64. width: 100%;
  65. }
  66. .sidebar nav ul {
  67. list-style-type: none;
  68. margin-bottom: 1em;
  69. padding: 0;
  70. &:last-child {
  71. margin-bottom: 2em;
  72. }
  73. a {
  74. text-decoration: none;
  75. }
  76. li {
  77. color: $text-white;
  78. padding-left: 2em;
  79. text-decoration: none;
  80. }
  81. li.active {
  82. background: $border-gray-darker;
  83. font-weight: bold;
  84. }
  85. li:hover {
  86. background: $border-gray-darker;
  87. }
  88. }
  89. .main {
  90. background-color: $bg-gray;
  91. width: calc(100% - #{$sidebar-width});
  92. }
  93. .main .main-inner {
  94. background-color: $white;
  95. padding: 2em;
  96. }
  97. .main .footer {
  98. margin: 0;
  99. padding: 2em;
  100. }
  101. .main table th {
  102. text-align: left;
  103. }
  104. .main .callout {
  105. border-left: 0.25em solid $white;
  106. padding: 1em;
  107. a {
  108. text-decoration: underline;
  109. }
  110. &.important {
  111. background-color: $bg-yellow-light;
  112. border-color: $bg-yellow;
  113. color: $black;
  114. }
  115. &.note {
  116. background-color: $bg-blue-light;
  117. border-color: $text-blue;
  118. color: $text-blue;
  119. }
  120. &.tip {
  121. background-color: $green-000;
  122. border-color: $green-700;
  123. color: $green-700;
  124. }
  125. &.warning {
  126. background-color: $red-000;
  127. border-color: $text-red;
  128. color: $text-red;
  129. }
  130. }
  131. .main .good pre {
  132. background-color: $bg-green-light;
  133. }
  134. .main .bad pre {
  135. background-color: $red-000;
  136. }
  137. @media all and (max-width: 768px) {
  138. body {
  139. flex-direction: column;
  140. }
  141. .sidebar {
  142. height: auto;
  143. position: relative;
  144. width: 100%;
  145. }
  146. .sidebar .expander {
  147. display: block;
  148. }
  149. .sidebar nav {
  150. height: 0;
  151. overflow: hidden;
  152. }
  153. .sidebar .nav-toggle:checked {
  154. & ~ nav {
  155. height: auto;
  156. }
  157. & + .expander .arrow {
  158. transform: rotate(-135deg);
  159. }
  160. }
  161. .main {
  162. width: 100%;
  163. }
  164. }