_extra-child-theme.scss 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. /**
  2. * Extra Child Theme Styles
  3. *
  4. * 0. Mixins & Variables
  5. * 1. General Styles
  6. * 2. Header & Navigation
  7. * 3. Main Wrapper and Content
  8. * 4. Footer & Footer Widgets
  9. * 5. Widgets
  10. * 6. Blocks
  11. */
  12. /**
  13. * 0. Mixins and Variables
  14. */
  15. @mixin alves-media( $res ) {
  16. @if laptop-only == $res {
  17. @media only screen and (max-width: #{map-deep-get($config-global, "breakpoint", "lg") - 1}) {
  18. @content;
  19. }
  20. }
  21. }
  22. $color_background: #{map-deep-get($config-global, "color", "background", "default")};
  23. $color_background_light: #{map-deep-get($config-global, "color", "background", "light")};
  24. $color_background_dark: #{map-deep-get($config-global, "color", "background", "dark")};
  25. $color_foreground: #{map-deep-get($config-global, "color", "foreground", "default")};
  26. $color_primary: #{map-deep-get($config-global, "color", "primary", "default")};
  27. $color_secondary: #{map-deep-get($config-global, "color", "secondary", "default")};
  28. $color_primary_hover: #{map-deep-get($config-global, "color", "primary", "hover")};
  29. $color_secondary_hover: #{map-deep-get($config-global, "color", "secondary", "hover")};
  30. $spacing_horizontal: #{map-deep-get($config-global, "spacing", "horizontal")};
  31. $spacing_vertical: #{map-deep-get($config-global, "spacing", "vertical")};
  32. $font_size_xs: #{map-deep-get($config-global, "font", "size", "xs")};
  33. $font_size_sm: #{map-deep-get($config-global, "font", "size", "sm")};
  34. $font_size_md: #{map-deep-get($config-global, "font", "size", "md")};
  35. $font_size_base: #{map-deep-get($config-global, "font", "size", "base")};
  36. $font_size_lg: #{map-deep-get($config-global, "font", "size", "lg")};
  37. $font_size_xl: #{map-deep-get($config-global, "font", "size", "xl")};
  38. $font_family_code: #{map-deep-get($config-global, "font", "family", "code")};
  39. $font_line_height_body: #{map-deep-get($config-global, "font", "line-height", "body")};
  40. $button_line_height: #{map-deep-get($config-button, "font", "line-height")};
  41. $button_font_weight: #{map-deep-get($config-button, "font", "weight")};
  42. $button_font_family: #{map-deep-get($config-button, "font", "family", "fallback")};
  43. $button_font_size: #{map-deep-get($config-button, "font", "size")};
  44. $button_spacing_vertical: #{map-deep-get($config-button, "padding", "vertical")};
  45. $button_spacing_horizontal: #{map-deep-get($config-button, "padding", "horizontal")};
  46. $button_background_hover: #{map-deep-get($config-button, "color", "background-hover")};
  47. $font_size_widget_title: #{map-deep-get($config-heading, "font", "size", "h4")};
  48. $footer_spacing_horizontal: 2 * map-deep-get($config-global, "spacing", "horizontal");
  49. $site_main_spacing_vertical: 2 * map-deep-get($config-global, "spacing", "vertical");
  50. /**
  51. * 1. General Styles
  52. */
  53. a {
  54. text-decoration: underline;
  55. &:hover,
  56. &:focus {
  57. text-decoration: none;
  58. }
  59. .wp-block-group &,
  60. .wp-block-cover &,
  61. .wp-block-cover-image &,
  62. .wp-block-media-text &,
  63. p:not(.site-title) & {
  64. text-decoration: underline;
  65. &.wp-block-button__link,
  66. &:hover {
  67. text-decoration: none;
  68. }
  69. }
  70. }
  71. .has-background {
  72. a {
  73. color: currentColor;
  74. }
  75. }
  76. a {
  77. text-decoration: none;
  78. }
  79. .entry-header,
  80. .page-header {
  81. padding-top: $spacing_vertical;
  82. }
  83. .site-info,
  84. .entry-footer,
  85. .entry-header,
  86. .page-title,
  87. .page-header,
  88. .author-title,
  89. .comments-title,
  90. .comment-reply-title {
  91. text-align: center;
  92. }
  93. button,
  94. .archive .read-more a,
  95. .blog .read-more a,
  96. .search-results .read-more a,
  97. .button,
  98. input[type="button"],
  99. input[type="reset"],
  100. input[type="submit"],
  101. .wp-block-button a {
  102. transition: background-color 0.125s ease-in;
  103. }
  104. .widget-title {
  105. @include font-family( map-deep-get($config-global, "font", "family", "primary" ) );
  106. }
  107. blockquote cite {
  108. @include font-family( map-deep-get($config-global, "font", "family", "secondary" ) );
  109. }
  110. .wp-block-quote p,
  111. blockquote p {
  112. font-size: $font_size_md;
  113. }
  114. .comment-reply-title {
  115. display: inherit;
  116. }
  117. .comment .comment-reply-title {
  118. display: flex;
  119. }
  120. .entry-meta,
  121. .entry-footer {
  122. color: $color_foreground;
  123. }
  124. /**
  125. * 2. Header & Navigation
  126. */
  127. /**
  128. * Wide Header & Footer
  129. */
  130. body:not(.fse-enabled) {
  131. #masthead {
  132. padding-left: 16px;
  133. padding-right: 16px;
  134. padding-bottom: $spacing_vertical;
  135. position: relative;
  136. @extend %responsive-alignwide-nested;
  137. @include media(desktop) {
  138. padding-left: 0;
  139. padding-right: 0;
  140. }
  141. }
  142. }
  143. /**
  144. * Mobile-Menu
  145. */
  146. .site-header {
  147. margin-left: 0;
  148. margin-right: 0;
  149. }
  150. /**
  151. * CSS-grid Desktop Menu
  152. */
  153. @include media(mobile) {
  154. .site-header {
  155. align-items: center;
  156. display: grid;
  157. margin-left: auto;
  158. margin-right: auto;
  159. grid-template-columns: auto;
  160. grid-template-rows: auto;
  161. grid-column-gap: #{map-deep-get($config-global, "spacing", "unit")};
  162. grid-template-areas:
  163. "site-logo site-logo"
  164. "site-title main-navigation"
  165. "site-description social-navigation";
  166. &:before,
  167. &:after {
  168. content: none;
  169. display: none;
  170. }
  171. & > * {
  172. margin-top: 0;
  173. margin-bottom: 0;
  174. }
  175. &.has-logo:not(.has-title-and-tagline) {
  176. grid-template-areas:
  177. "site-logo main-navigation"
  178. "site-logo social-navigation";
  179. }
  180. .site-logo {
  181. grid-area: site-logo;
  182. margin-bottom: #{map-deep-get($config-global, "spacing", "unit")};
  183. }
  184. .site-title {
  185. grid-area: site-title;
  186. & + .site-description {
  187. margin-top: 0;
  188. }
  189. }
  190. .site-description {
  191. align-self: center;
  192. grid-area: site-description;
  193. }
  194. .main-navigation {
  195. align-self: center;
  196. display: flex;
  197. justify-content: flex-end;
  198. grid-area: main-navigation;
  199. flex-wrap: wrap;
  200. & > div {
  201. justify-content: flex-end;
  202. }
  203. & > div > ul {
  204. justify-content: flex-end;
  205. margin-left: -#{0.5 * map-deep-get($config-global, "spacing", "horizontal")};
  206. margin-right: -#{0.5 * map-deep-get($config-global, "spacing", "horizontal")};
  207. & > li {
  208. padding-left: #{map-deep-get($config-header, "main-nav", "link-padding")};
  209. padding-right: #{map-deep-get($config-header, "main-nav", "link-padding")};
  210. padding-top: $baseline-unit;
  211. padding-bottom: $baseline-unit;
  212. & > a {
  213. padding: 0;
  214. }
  215. .sub-menu {
  216. a {
  217. background: $color_primary;
  218. color: $color_background;
  219. &:hover,
  220. &:focus {
  221. text-decoration: underline;
  222. }
  223. }
  224. }
  225. }
  226. & > .menu-item-has-children > a::after {
  227. font-size: #{0.5 * map-deep-get($config-global, "font", "size", "base")};
  228. }
  229. }
  230. & > div > ul > li:hover,
  231. & > div > ul > li:focus-within,
  232. & > div > ul > li.current-menu-item {
  233. & > ul {
  234. box-shadow: none;
  235. overflow: hidden;
  236. &:before {
  237. border-bottom: #{0.5 * map-deep-get($config-global, "spacing", "unit")} solid #{map-deep-get($config-global, "color", "primary", "default")};
  238. border-left: #{0.5 * map-deep-get($config-global, "spacing", "unit")} solid transparent;
  239. border-right: #{0.5 * map-deep-get($config-global, "spacing", "unit")} solid transparent;
  240. content: "";
  241. display: block;
  242. margin-left: #{map-deep-get($config-global, "spacing", "unit")};
  243. width: #{map-deep-get($config-global, "spacing", "unit")};
  244. }
  245. }
  246. }
  247. }
  248. .social-navigation {
  249. align-self: center;
  250. grid-area: social-navigation;
  251. justify-self: flex-end;
  252. }
  253. }
  254. }
  255. .main-navigation > div > ul > li:first-of-type,
  256. .social-navigation > div > ul > li:first-of-type {
  257. margin-left: 0;
  258. }
  259. .main-navigation > div > ul > li:last-of-type,
  260. .social-navigation > div > ul > li:last-of-type {
  261. margin-right: 0;
  262. }
  263. .footer-navigation .footer-menu > li:first-of-type {
  264. margin-left: 0;
  265. }
  266. // Social Menu
  267. .social-navigation {
  268. & > div > ul {
  269. flex-wrap: wrap;
  270. }
  271. }
  272. .main-navigation > div {
  273. text-align: left;
  274. }
  275. .pagination .nav-links {
  276. justify-content: center;
  277. }
  278. /**
  279. * 3. Main Wrapper and Content
  280. */
  281. .home.page.hide-homepage-title {
  282. .site-content {
  283. .site-main {
  284. padding-top: 0;
  285. }
  286. @include media(mobile-only) {
  287. padding-top: $spacing_vertical;
  288. }
  289. }
  290. }
  291. .site-content {
  292. .site-main {
  293. padding-top: 0;
  294. padding-bottom: 0;
  295. }
  296. }
  297. /**
  298. * 4. Footer & Footer Widgets
  299. */
  300. .site-footer {
  301. margin: 0 auto;
  302. display: block;
  303. padding-left: $spacing_horizontal;
  304. padding-right: $spacing_horizontal;
  305. button,
  306. .button,
  307. input[type="button"],
  308. input[type="reset"],
  309. input[type="submit"], {
  310. &:hover {
  311. }
  312. }
  313. #footer-widgets {
  314. border-bottom: 1px solid #{map-deep-get($config-global, "color", "border", "light")};
  315. @extend %responsive-alignwide-nested;
  316. display: flex;
  317. flex-wrap: nowrap;
  318. flex: 1 0 100%;
  319. margin: 0 auto;
  320. @include alves-media(laptop-only) {
  321. display: block;
  322. }
  323. .widget-area {
  324. flex: 1;
  325. font-size: $font_size_sm;
  326. @include media(laptop) {
  327. padding-right: $footer_spacing_horizontal;
  328. &:last-of-type {
  329. padding-right: 0;
  330. }
  331. }
  332. }
  333. }
  334. #footer-info-wrapper {
  335. @extend %responsive-alignwide-nested;
  336. display: flex;
  337. margin: 0 auto;
  338. padding-top: ($baseline-unit * .75);
  339. max-width: 100%;
  340. a {
  341. color: $color_foreground;
  342. @include font-family( map-deep-get( $config-global, "font", "family", "secondary" ) );
  343. padding: 0;
  344. text-decoration: none;
  345. &:hover,
  346. &:focus {
  347. color: $color_primary;
  348. }
  349. }
  350. .footer-navigation {
  351. order: 1;
  352. flex-wrap: nowrap;
  353. flex: 1;
  354. text-align: left;
  355. padding-right: $spacing_horizontal;
  356. .footer-menu {
  357. display: block;
  358. justify-content: left;
  359. margin: 0;
  360. li:after {
  361. content: ' · ';
  362. display: inline;
  363. padding-right: 5px;
  364. vertical-align: middle;
  365. }
  366. li:last-of-type:after {
  367. content: '';
  368. }
  369. }
  370. }
  371. .site-info {
  372. color: $color_secondary;
  373. text-align: right;
  374. order: 2;
  375. font-style: italic;
  376. flex-wrap: nowrap;
  377. flex: 1;
  378. }
  379. }
  380. }
  381. /**
  382. * 5. Widgets
  383. */
  384. .widget {
  385. .widget-title {
  386. margin-bottom: $spacing_vertical;
  387. }
  388. ul {
  389. list-style: none;
  390. padding-left: 0;
  391. &.children > li {
  392. margin-bottom: 0;
  393. margin-top: 0;
  394. border: 0;
  395. a {
  396. padding-left: $spacing_horizontal;
  397. }
  398. }
  399. li {
  400. a {
  401. padding: ($baseline-unit * .75) 0;
  402. &:hover {
  403. text-decoration: underline;
  404. }
  405. }
  406. &.recentcomments a {
  407. padding: ($baseline-unit * .75) 0 !important;
  408. }
  409. }
  410. }
  411. }
  412. /**
  413. * 6. Blocks
  414. */
  415. .wp-block-latest-posts {
  416. > li {
  417. > a {
  418. display: inline-block;
  419. text-decoration: none;
  420. &:hover,
  421. &:focus,
  422. &:active {
  423. text-decoration: underline;
  424. }
  425. }
  426. }
  427. .wp-block-latest-posts__post-excerpt,
  428. .wp-block-latest-posts__post-full-content {
  429. margin-top: $spacing_vertical;
  430. }
  431. }
  432. .wp-block-newspack-blocks-homepage-articles article .entry-title a {
  433. text-decoration: none;
  434. }
  435. .wp-block-newspack-blocks-homepage-articles {
  436. article {
  437. .entry-title a {
  438. &:active,
  439. &:focus,
  440. &:hover {
  441. text-decoration: none;
  442. }
  443. }
  444. .cat-links a,
  445. .more-link,
  446. .entry-meta a {
  447. text-decoration: none;
  448. &:active,
  449. &:focus,
  450. &:hover {
  451. text-decoration: underline;
  452. }
  453. }
  454. }
  455. &.image-alignbehind article {
  456. .entry-title a {
  457. &:active,
  458. &:focus,
  459. &:hover {
  460. color: #fff;
  461. text-decoration: underline;
  462. }
  463. }
  464. }
  465. }
  466. .has-background:not(.has-background-background-color),
  467. [class*="background-color"]:not(.has-background-background-color),
  468. [style*="background-color"] {
  469. .wp-block-newspack-blocks-homepage-articles article {
  470. .entry-title a{
  471. &:active,
  472. &:focus,
  473. &:hover {
  474. text-decoration: underline;
  475. }
  476. }
  477. }
  478. }
  479. // Updates the Mobile Navigation to be next to the site title.
  480. @import "../../varia/sass/components/header/_site-mobile-nav-side";
  481. /**
  482. * Search block
  483. */
  484. .wp-block-search {
  485. &.wp-block-search__button-inside {
  486. .wp-block-search__inside-wrapper{
  487. border-radius: #{map-deep-get($config-button, "border-radius")};
  488. }
  489. .wp-block-search__input {
  490. background: transparent;
  491. }
  492. }
  493. .wp-block-search__input {
  494. margin-right: calc( .1 * #{map-deep-get($config-button, "padding", "horizontal")} );
  495. border-radius: #{map-deep-get($config-button, "border-radius")};
  496. }
  497. }