_extra-child-theme.scss 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  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,
  232. & > div > ul > li.current-menu-item {
  233. & > a {
  234. }
  235. & > ul {
  236. box-shadow: none;
  237. overflow: hidden;
  238. &:before {
  239. border-bottom: #{0.5 * map-deep-get($config-global, "spacing", "unit")} solid #{map-deep-get($config-global, "color", "primary", "default")};
  240. border-left: #{0.5 * map-deep-get($config-global, "spacing", "unit")} solid transparent;
  241. border-right: #{0.5 * map-deep-get($config-global, "spacing", "unit")} solid transparent;
  242. content: "";
  243. display: block;
  244. margin-left: #{map-deep-get($config-global, "spacing", "unit")};
  245. width: #{map-deep-get($config-global, "spacing", "unit")};
  246. }
  247. }
  248. & li {
  249. & > a {
  250. }
  251. &:hover > a,
  252. &.focus > a,
  253. &.current-menu-item > a {
  254. }
  255. }
  256. }
  257. }
  258. .social-navigation {
  259. align-self: center;
  260. grid-area: social-navigation;
  261. justify-self: flex-end;
  262. }
  263. }
  264. }
  265. .main-navigation > div > ul > li:first-of-type,
  266. .social-navigation > div > ul > li:first-of-type {
  267. margin-left: 0;
  268. }
  269. .main-navigation > div > ul > li:last-of-type,
  270. .social-navigation > div > ul > li:last-of-type {
  271. margin-right: 0;
  272. }
  273. .footer-navigation .footer-menu > li:first-of-type {
  274. margin-left: 0;
  275. }
  276. // Social Menu
  277. .social-navigation {
  278. & > div > ul {
  279. flex-wrap: wrap;
  280. }
  281. }
  282. .main-navigation > div {
  283. text-align: left;
  284. }
  285. .pagination .nav-links {
  286. justify-content: center;
  287. }
  288. /**
  289. * 3. Main Wrapper and Content
  290. */
  291. .home.page.hide-homepage-title {
  292. .site-content {
  293. .site-main {
  294. padding-top: 0;
  295. }
  296. @include media(mobile-only) {
  297. padding-top: $spacing_vertical;
  298. }
  299. }
  300. }
  301. .site-content {
  302. .site-main {
  303. padding-top: 0;
  304. padding-bottom: 0;
  305. }
  306. }
  307. /**
  308. * 4. Footer & Footer Widgets
  309. */
  310. .site-footer {
  311. margin: 0 auto;
  312. display: block;
  313. padding-left: $spacing_horizontal;
  314. padding-right: $spacing_horizontal;
  315. button,
  316. .button,
  317. input[type="button"],
  318. input[type="reset"],
  319. input[type="submit"], {
  320. &:hover {
  321. }
  322. }
  323. #footer-widgets {
  324. border-bottom: 1px solid #{map-deep-get($config-global, "color", "border", "light")};
  325. @extend %responsive-alignwide-nested;
  326. display: flex;
  327. flex-wrap: nowrap;
  328. flex: 1 0 100%;
  329. margin: 0 auto;
  330. @include alves-media(laptop-only) {
  331. display: block;
  332. }
  333. .widget-area {
  334. flex: 1;
  335. font-size: $font_size_sm;
  336. @include media(laptop) {
  337. padding-right: $footer_spacing_horizontal;
  338. &:last-of-type {
  339. padding-right: 0;
  340. }
  341. }
  342. }
  343. }
  344. #footer-info-wrapper {
  345. @extend %responsive-alignwide-nested;
  346. display: flex;
  347. margin: 0 auto;
  348. padding-top: ($baseline-unit * .75);
  349. max-width: 100%;
  350. a {
  351. color: $color_foreground;
  352. @include font-family( map-deep-get( $config-global, "font", "family", "secondary" ) );
  353. padding: 0;
  354. text-decoration: none;
  355. &:hover,
  356. &:focus {
  357. color: $color_primary;
  358. }
  359. }
  360. .footer-navigation {
  361. order: 1;
  362. flex-wrap: nowrap;
  363. flex: 1;
  364. text-align: left;
  365. padding-right: $spacing_horizontal;
  366. .footer-menu {
  367. display: block;
  368. justify-content: left;
  369. margin: 0;
  370. li:after {
  371. content: ' · ';
  372. display: inline;
  373. padding-right: 5px;
  374. vertical-align: middle;
  375. }
  376. li:last-of-type:after {
  377. content: '';
  378. }
  379. }
  380. }
  381. .site-info {
  382. color: $color_secondary;
  383. text-align: right;
  384. order: 2;
  385. font-style: italic;
  386. flex-wrap: nowrap;
  387. flex: 1;
  388. }
  389. }
  390. }
  391. /**
  392. * 5. Widgets
  393. */
  394. .widget {
  395. .widget-title {
  396. margin-bottom: $spacing_vertical;
  397. }
  398. ul {
  399. list-style: none;
  400. padding-left: 0;
  401. &.children > li {
  402. margin-bottom: 0;
  403. margin-top: 0;
  404. border: 0;
  405. a {
  406. padding-left: $spacing_horizontal;
  407. }
  408. }
  409. li {
  410. a {
  411. padding: ($baseline-unit * .75) 0;
  412. &:hover {
  413. text-decoration: underline;
  414. }
  415. }
  416. &.recentcomments a {
  417. padding: ($baseline-unit * .75) 0 !important;
  418. }
  419. }
  420. }
  421. }
  422. /**
  423. * 6. Blocks
  424. */
  425. .wp-block-latest-posts {
  426. > li {
  427. > a {
  428. display: inline-block;
  429. text-decoration: none;
  430. &:hover,
  431. &:focus,
  432. &:active {
  433. text-decoration: underline;
  434. }
  435. }
  436. }
  437. .wp-block-latest-posts__post-excerpt,
  438. .wp-block-latest-posts__post-full-content {
  439. margin-top: $spacing_vertical;
  440. }
  441. }
  442. .wp-block-newspack-blocks-homepage-articles article .entry-title a {
  443. text-decoration: none;
  444. }
  445. .wp-block-newspack-blocks-homepage-articles {
  446. article {
  447. .entry-title a {
  448. &:active,
  449. &:focus,
  450. &:hover {
  451. text-decoration: none;
  452. }
  453. }
  454. .cat-links a,
  455. .more-link,
  456. .entry-meta a {
  457. text-decoration: none;
  458. &:active,
  459. &:focus,
  460. &:hover {
  461. text-decoration: underline;
  462. }
  463. }
  464. }
  465. &.image-alignbehind article {
  466. .entry-title a {
  467. &:active,
  468. &:focus,
  469. &:hover {
  470. color: #fff;
  471. text-decoration: underline;
  472. }
  473. }
  474. }
  475. }
  476. .has-background:not(.has-background-background-color),
  477. [class*="background-color"]:not(.has-background-background-color),
  478. [style*="background-color"] {
  479. .wp-block-newspack-blocks-homepage-articles article {
  480. .entry-title a{
  481. &:active,
  482. &:focus,
  483. &:hover {
  484. text-decoration: underline;
  485. }
  486. }
  487. }
  488. }
  489. // Updates the Mobile Navigation to be next to the site title.
  490. @import "../../varia/sass/components/header/_site-mobile-nav-side";
  491. /**
  492. * Search block
  493. */
  494. .wp-block-search {
  495. &.wp-block-search__button-inside {
  496. .wp-block-search__inside-wrapper{
  497. border-radius: #{map-deep-get($config-button, "border-radius")};
  498. }
  499. .wp-block-search__input {
  500. background: transparent;
  501. }
  502. }
  503. .wp-block-search__input {
  504. margin-right: calc( .1 * #{map-deep-get($config-button, "padding", "horizontal")} );
  505. border-radius: #{map-deep-get($config-button, "border-radius")};
  506. }
  507. }