_extra-child-theme.scss 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. /**
  2. * Extra Child Theme Styles
  3. *
  4. * 1. General Helper Styles
  5. * 2. Header
  6. * 3. Main Wrapper and Content
  7. * 4. Navigation Menu
  8. * 5. Archive Pagination and Post Navigation
  9. * 6. Block Specific Styles
  10. * 6.1. Column Block
  11. * 6.2. Quote Block
  12. * 6.3. Hero Block and Cover Block
  13. * 6.4. File Block
  14. * 6.5. Latest Comments Block
  15. * 6.6. Button Block
  16. * 6.7. Posts List Block
  17. * 6.8. Search Block
  18. * 7. Widgets
  19. * 8. AMP Support
  20. */
  21. $color_background: #{map-deep-get($config-global, "color", "background", "default")};
  22. $color_background_light: #{map-deep-get($config-global, "color", "background", "light")};
  23. $color_foreground: #{map-deep-get($config-global, "color", "foreground", "default")};
  24. $color_primary: #{map-deep-get($config-global, "color", "primary", "default")};
  25. $color_secondary: #{map-deep-get($config-global, "color", "secondary", "default")};
  26. $color_primary_hover: #{map-deep-get($config-global, "color", "primary", "hover")};
  27. $spacing_horizontal: #{map-deep-get($config-global, "spacing", "horizontal")};
  28. $spacing_vertical: #{map-deep-get($config-global, "spacing", "vertical")};
  29. $font_size_xs: #{map-deep-get($config-global, "font", "size", "xs")};
  30. $font_size_md: #{map-deep-get($config-global, "font", "size", "md")};
  31. $font_size_base: #{map-deep-get($config-global, "font", "size", "base")};
  32. $font_size_lg: #{map-deep-get($config-global, "font", "size", "lg")};
  33. $font_size_xl: #{map-deep-get($config-global, "font", "size", "xl")};
  34. $font_family_code: #{map-deep-get($config-global, "font", "family", "code")};
  35. $font_line_height_body: #{map-deep-get($config-global, "font", "line-height", "body")};
  36. $button_line_height: #{map-deep-get($config-button, "font", "line-height")};
  37. $button_font_weight: #{map-deep-get($config-button, "font", "weight")};
  38. $button_font_size: #{map-deep-get($config-button, "font", "size")};
  39. $button_spacing_vertical: #{map-deep-get($config-button, "padding", "vertical")};
  40. $button_spacing_horizontal: #{map-deep-get($config-button, "padding", "horizontal")};
  41. $button_color_hover: #{map-deep-get($config-button, "color", "text-hover")};
  42. $button_background_hover: #{map-deep-get($config-button, "color", "background-hover")};
  43. $font_size_widget_title: #{map-deep-get($config-heading, "font", "size", "h4")};
  44. /**
  45. * 1. General Styles
  46. */
  47. h1,
  48. h2,
  49. h3,
  50. h4,
  51. h5,
  52. h6 {
  53. color: $color_primary;
  54. }
  55. a {
  56. text-decoration: none;
  57. .wp-block-group &,
  58. .wp-block-cover &,
  59. .wp-block-cover-image &,
  60. .wp-block-media-text &,
  61. p:not(.site-title) & {
  62. text-decoration: underline;
  63. &.wp-block-button__link,
  64. &:hover {
  65. text-decoration: none;
  66. }
  67. }
  68. }
  69. /**
  70. * 2. Header
  71. */
  72. #masthead {
  73. border-bottom: 1px solid $color_background_light;
  74. background: $color_background;
  75. -webkit-transition: all .25s ease-in-out;
  76. -moz-transition: all .25s ease-in-out;
  77. transition: all .25s ease-in-out;
  78. width: 100%;
  79. .site-header-wrapper {
  80. display: flex;
  81. flex-wrap: wrap;
  82. position: relative;
  83. z-index: 1;
  84. -webkit-align-items: center;
  85. -ms-flex-align: center;
  86. align-items: center;
  87. .site-branding {
  88. -webkit-transition: margin-top .25s ease-in-out;
  89. -moz-transition: margin-top .25s ease-in-out;
  90. transition: margin-top .25s ease-in-out;
  91. margin-right: auto;
  92. .site-description {
  93. display: none;
  94. }
  95. .site-title {
  96. a {
  97. text-decoration: none;
  98. }
  99. }
  100. .site-logo {
  101. margin-bottom: $spacing_horizontal;
  102. }
  103. }
  104. .site-menu {
  105. display: block;
  106. -webkit-flex: 0 1 auto;
  107. -ms-flex: 0 1 auto;
  108. flex: 0 1 auto;
  109. @include media(mobile-only) {
  110. width: 100%;
  111. }
  112. }
  113. .main-navigation {
  114. > ul {
  115. > li {
  116. &.current-menu-item {
  117. a {
  118. border-color: $color_secondary;
  119. border-style: solid;
  120. border-width: 0 0 .125em;
  121. color: $color_primary_hover;
  122. }
  123. }
  124. }
  125. }
  126. ul {
  127. li {
  128. &.current-menu-item {
  129. > a {
  130. border-color: $color_secondary;
  131. border-style: solid;
  132. border-width: 0 0 .125em;
  133. color: $color_primary_hover;
  134. }
  135. }
  136. a {
  137. &::after {
  138. color: $color_primary_hover;
  139. }
  140. }
  141. ul {
  142. color: $color_background_light;
  143. li {
  144. border-bottom: 1px solid;
  145. margin: 0;
  146. &:first-child {
  147. border-top: 1px solid;
  148. }
  149. &.current-menu-item {
  150. a {
  151. border: none;
  152. }
  153. }
  154. }
  155. }
  156. }
  157. }
  158. }
  159. @include media(mobile) {
  160. .main-navigation {
  161. > ul {
  162. > li {
  163. &:first-child {
  164. margin-left: 0;
  165. }
  166. }
  167. }
  168. ul {
  169. li {
  170. margin: 0 .75em;
  171. &:first-child {
  172. margin-left: 0;
  173. }
  174. &:hover {
  175. ul {
  176. left: auto;
  177. right: 0;
  178. }
  179. }
  180. a {
  181. padding: .25em 0;
  182. }
  183. ul {
  184. li {
  185. a {
  186. padding: .75em;
  187. }
  188. }
  189. }
  190. }
  191. }
  192. }
  193. }
  194. }
  195. }
  196. @include media(mobile) {
  197. .site-header {
  198. padding-right: $spacing_vertical;
  199. padding-left: $spacing_vertical;
  200. position: fixed;
  201. z-index: 9999;
  202. }
  203. }
  204. @include media(mobile-only) {
  205. .site-title,
  206. .site-description {
  207. font-size: $font_size_xl;
  208. hyphens: auto;
  209. }
  210. }
  211. /**
  212. * 4. Navigation
  213. */
  214. /**
  215. * 4.1 Main Navigation
  216. */
  217. @include media(mobile-only) {
  218. #toggle-menu {
  219. position: absolute;
  220. top: 0;
  221. right: 0;
  222. }
  223. }
  224. /**
  225. * 4.2 Social Navigation
  226. */
  227. .social-links-menu {
  228. display: flex;
  229. flex-wrap: wrap;
  230. justify-content: flex-end;
  231. }
  232. @include media(mobile-only) {
  233. .social-links-menu {
  234. justify-content: center;
  235. }
  236. }
  237. /**
  238. * 5. Archive Pagination and Post Navigation
  239. */
  240. /**
  241. * 6. Block Specific Styles
  242. */
  243. /**
  244. * 6.1. Column Block
  245. */
  246. /**
  247. * 6.2. Quote Block
  248. */
  249. .wp-block-quote,
  250. .wp-block-quote[style*="text-align:center"],
  251. .wp-block-quote[style*="text-align:right"] {
  252. border: 1px solid $color_background_light;
  253. padding: $spacing_horizontal;
  254. &.is-style-large {
  255. p {
  256. line-height: $font_line_height_body;
  257. }
  258. }
  259. p {
  260. @include font-family( map-deep-get($config-global, "font", "family", "secondary") );
  261. font-size: $font_size_md;
  262. line-height: $font_line_height_body;
  263. }
  264. cite {
  265. color: inherit;
  266. font-size: $font_size_md;
  267. }
  268. }
  269. /**
  270. * 6.3. Hero Block and Cover Block
  271. */
  272. /**
  273. * 6.4. File Block
  274. */
  275. .wp-block-file {
  276. a {
  277. &.wp-block-file__button {
  278. line-height: $button_line_height;
  279. cursor: pointer;
  280. font-weight: $button_font_weight;
  281. @include font-family( map-deep-get($config-button, "font", "family") );
  282. // font-size: $button_font_size;
  283. padding: $button_spacing_vertical $button_spacing_horizontal;
  284. display: inline-block;
  285. &:focus,
  286. &:hover {
  287. color: $button_color_hover;
  288. background-color: $button_background_hover;
  289. opacity: 1;
  290. }
  291. }
  292. }
  293. }
  294. /**
  295. * 6.5. Latest Comments Block
  296. */
  297. .wp-block-latest-comments {
  298. .wp-block-latest-comments__comment-meta {
  299. @include font-family( map-deep-get($config-global, "font", "family", "secondary") );
  300. }
  301. }
  302. /**
  303. * 6.6. Button Block
  304. * 6.7. Posts List Block
  305. * 6.8. Search Block
  306. */
  307. .wp-block-button, .a8c-posts-list {
  308. &.minimal {
  309. a {
  310. background: 0 0;
  311. border: 2px solid;
  312. }
  313. }
  314. }
  315. button,
  316. .button,
  317. input[type="submit"],
  318. .wp-block-button__link,
  319. .wp-block-file__button,
  320. .a8c-posts-list__view-all,
  321. button[data-load-more-btn] {
  322. border: 0;
  323. border-radius: 5em;
  324. text-transform: uppercase;
  325. &.has-background {
  326. &:focus,
  327. &:hover,
  328. &:visited {
  329. opacity: .8;
  330. }
  331. }
  332. }
  333. .wp-block-coblocks-hero__box,
  334. .wp-block-cover__inner-container,
  335. .wp-block-columns,
  336. .wp-block-group {
  337. .wp-block-latest-posts {
  338. border-bottom: 1px solid $color_background_light;
  339. > li {
  340. border-top: 1px solid $color_background_light;
  341. margin: 0;
  342. padding-top: $spacing_horizontal;
  343. padding-bottom: $spacing_horizontal;
  344. > a {
  345. font-size: $font_size_base;
  346. font-weight: normal;
  347. @include font-family( map-deep-get($config-global, "font", "family", "secondary") );
  348. line-height: $font_line_height_body;
  349. }
  350. > time {
  351. &.wp-block-latest-posts__post-date {
  352. font-size: $font_size_base;
  353. }
  354. }
  355. }
  356. }
  357. }
  358. .wp-block-newspack-blocks-homepage-articles {
  359. article {
  360. .entry-title a {
  361. &:active,
  362. &:focus,
  363. &:hover {
  364. text-decoration: none;
  365. }
  366. }
  367. .more-link {
  368. &:active,
  369. &:focus,
  370. &:hover {
  371. color: #{map-deep-get($config-global, "color", "primary", "hover")};
  372. }
  373. }
  374. .cat-links a,
  375. .more-link,
  376. .entry-meta a {
  377. text-decoration: none;
  378. &:active,
  379. &:focus,
  380. &:hover {
  381. text-decoration: underline;
  382. }
  383. }
  384. }
  385. &.image-alignbehind article {
  386. .entry-title a {
  387. &:active,
  388. &:focus,
  389. &:hover {
  390. color: #fff;
  391. text-decoration: underline;
  392. }
  393. }
  394. .more-link {
  395. &:active,
  396. &:focus,
  397. &:hover {
  398. color: inherit;
  399. }
  400. }
  401. }
  402. }
  403. .has-background:not(.has-background-background-color),
  404. [class*="background-color"]:not(.has-background-background-color),
  405. [style*="background-color"] {
  406. .wp-block-newspack-blocks-homepage-articles article {
  407. .entry-title a{
  408. &:active,
  409. &:focus,
  410. &:hover {
  411. text-decoration: underline;
  412. }
  413. }
  414. .more-link {
  415. &:active,
  416. &:focus,
  417. &:hover {
  418. color: inherit;
  419. }
  420. }
  421. }
  422. }
  423. /**
  424. * 7. Widgets
  425. */
  426. .site-footer {
  427. .widget-area {
  428. .widget-title {
  429. font-size: $font_size_widget_title;
  430. margin-bottom: .857em;
  431. }
  432. }
  433. }
  434. /**
  435. * 6.9. Code, Pre Blocks
  436. */
  437. .wp-block-code {
  438. code {
  439. font-family: $font_family_code;
  440. font-size: $font_size_base;
  441. }
  442. }
  443. .wp-block-preformatted,
  444. .wp-block-verse {
  445. font-family: $font_family_code;
  446. font-size: $font_size_base;
  447. }
  448. /**
  449. * 8. AMP Support
  450. */
  451. html[amp] {
  452. @include media( mobile ) {
  453. .site-header {
  454. position: sticky;
  455. top: 0;
  456. }
  457. .logged-in .site-header {
  458. top: 32px;
  459. }
  460. }
  461. @media screen and ( max-width: 782px ) {
  462. .logged-in .site-header {
  463. top: 46px;
  464. }
  465. }
  466. }