_extra-child-theme.scss 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659
  1. /**
  2. * Extra Child Theme Styles
  3. */
  4. a {
  5. text-decoration: none;
  6. .wp-block-cover &,
  7. .wp-block-cover-image &,
  8. .wp-block-media-text &,
  9. p:not(.site-title) & {
  10. text-decoration: underline;
  11. &.wp-block-button__link,
  12. &:hover {
  13. text-decoration: none;
  14. }
  15. }
  16. }
  17. #page {
  18. background: #{map-deep-get($config-global, "color", "background", "default")};
  19. margin-left: auto;
  20. margin-right: auto;
  21. @include media(desktop) {
  22. box-shadow: 0 0 30px rgba(#000, 0.2);
  23. max-width: $content-width-xxl;
  24. }
  25. }
  26. body {
  27. background: #{map-deep-get($config-global, "color", "background", "white")};
  28. @include media(mobile) {
  29. background: #{map-deep-get($config-global, "color", "background", "light")};
  30. }
  31. }
  32. /**
  33. * Wide Header & Footer
  34. */
  35. #masthead {
  36. position: relative;
  37. .site-header-wrap {
  38. @extend %responsive-alignwide;
  39. margin-left: auto;
  40. margin-right: auto;
  41. @include media(mobile-only) {
  42. & > * {
  43. margin-top: #{map-deep-get($config-global, "spacing", "unit")};
  44. margin-bottom: #{map-deep-get($config-global, "spacing", "unit")};
  45. max-width: 100%;
  46. &:first-child {
  47. margin-top: 0;
  48. }
  49. &:last-child {
  50. margin-bottom: 0;
  51. }
  52. }
  53. }
  54. }
  55. }
  56. #colophon {
  57. padding-left: 0;
  58. padding-right: 0;
  59. @include media(mobile-only) {
  60. padding-left: map-deep-get($config-global, "spacing", "horizontal");
  61. padding-right: map-deep-get($config-global, "spacing", "horizontal");
  62. }
  63. }
  64. /**
  65. * Mobile-Menu
  66. */
  67. .main-navigation #toggle:focus + #toggle-menu,
  68. #toggle-menu {
  69. background: map-deep-get($config-global, "color", "background", "default");
  70. color: map-deep-get($config-global, "color", "foreground", "default");
  71. text-decoration: none;
  72. &:active,
  73. &:focus,
  74. &:hover {
  75. background: map-deep-get($config-global, "color", "primary", "default");
  76. color: map-deep-get($config-global, "color", "background", "default");
  77. }
  78. }
  79. /**
  80. * CSS-grid Desktop Menu
  81. */
  82. @include media(mobile) {
  83. .site-header-wrap {
  84. align-items: center;
  85. display: grid;
  86. grid-template-columns: auto;
  87. grid-template-rows: auto;
  88. grid-column-gap: #{map-deep-get($config-global, "spacing", "unit")};
  89. grid-template-areas:
  90. "site-logo site-logo"
  91. "site-title main-navigation"
  92. "site-description social-navigation";
  93. &:before,
  94. &:after {
  95. content: none;
  96. display: none;
  97. }
  98. & > * {
  99. margin-top: 0;
  100. margin-bottom: 0;
  101. }
  102. &.has-logo:not(.has-title-and-tagline) {
  103. grid-template-areas:
  104. "site-logo main-navigation"
  105. "site-logo social-navigation";
  106. }
  107. .site-logo {
  108. grid-area: site-logo;
  109. margin-bottom: #{map-deep-get($config-global, "spacing", "unit")};
  110. }
  111. .site-title {
  112. align-self: flex-end;
  113. grid-area: site-title;
  114. & + .site-description {
  115. margin-top: 0;
  116. }
  117. }
  118. .site-description {
  119. align-self: center;
  120. grid-area: site-description;
  121. }
  122. .main-navigation {
  123. align-self: center;
  124. grid-area: main-navigation;
  125. justify-self: flex-end;
  126. & > div > ul {
  127. justify-content: flex-end;
  128. & > .menu-item-has-children > a::after {
  129. font-size: #{0.5 * map-deep-get($config-global, "font", "size", "base")};
  130. }
  131. }
  132. & > div > ul > li:hover,
  133. & > div > ul > li:focus-within,
  134. & > div > ul > li.current-menu-item {
  135. & > a {
  136. color: rgba(map-deep-get($config-global, "color", "background", "default"), 0.8);
  137. }
  138. & > ul {
  139. background: #{map-deep-get($config-global, "color", "foreground", "default")};
  140. border: 1px solid #{map-deep-get($config-global, "color", "foreground", "dark")};
  141. border-radius: #{map-deep-get($config-global, "border-radius", "sm")};
  142. overflow: hidden;
  143. }
  144. & li {
  145. border-top: 1px solid #{map-deep-get($config-global, "color", "foreground", "dark")};
  146. &:first-child {
  147. border-top: 0;
  148. }
  149. & > a {
  150. background: #{map-deep-get($config-global, "color", "foreground", "default")};
  151. color: #{map-deep-get($config-global, "color", "background", "default")};
  152. padding: #{0.5 * map-deep-get($config-global, "spacing", "unit")} #{1.5 * map-deep-get($config-global, "spacing", "unit")};
  153. }
  154. &:hover > a,
  155. &.focus > a,
  156. &.current-menu-item > a {
  157. background: #{map-deep-get($config-global, "color", "primary", "default")};
  158. }
  159. }
  160. }
  161. & > div > ul > li.current-menu-item {
  162. & > a {
  163. color: inherit;
  164. box-shadow: 0 2px 0;
  165. }
  166. }
  167. }
  168. .social-navigation {
  169. align-self: center;
  170. grid-area: social-navigation;
  171. justify-self: flex-end;
  172. }
  173. }
  174. }
  175. // Social Menu
  176. .social-navigation {
  177. & > div > ul {
  178. flex-wrap: wrap;
  179. }
  180. }
  181. /**
  182. * Header
  183. */
  184. #masthead {
  185. background: #{map-deep-get($config-global, "color", "foreground", "default")};
  186. & > * {
  187. position: relative;
  188. }
  189. }
  190. // Site Title
  191. .site-description {
  192. color: #{map-deep-get($config-header, "branding", "color", "text")};
  193. }
  194. /**
  195. * Main
  196. */
  197. @include media(mobile) {
  198. #main {
  199. padding-top: #{2 * map-deep-get($config-global, "spacing", "vertical")};
  200. }
  201. }
  202. /**
  203. * Footer
  204. */
  205. // Footer Menu
  206. .footer-navigation .footer-menu {
  207. a {
  208. font-size: #{map-deep-get($config-global, "font", "size", "xs")};
  209. line-height: #{map-deep-get($config-global, "font", "line-height", "xs")};
  210. }
  211. }
  212. /**
  213. * Blocks
  214. */
  215. // Add space for floated content
  216. @media only screen and (min-width: 560px) {
  217. .entry-content > .wp-block-button:not(.alignleft):not(.alignright),
  218. .entry-content > .alignleft {
  219. margin-right: #{map-deep-get($config-global, "spacing", "horizontal")};
  220. }
  221. .entry-content > .alignright {
  222. margin-left: #{map-deep-get($config-global, "spacing", "horizontal")};
  223. }
  224. }
  225. // Constrain left-aligned blocks
  226. @media only screen and (min-width: 640px) {
  227. .entry-content > .wp-block-button:not(.alignleft):not(.alignright),
  228. .entry-content > .alignleft {
  229. margin-left: calc( 0.5 * (100% - calc( 640px - 32px)));
  230. max-width: calc( 0.5 * calc( 782px - 32px));
  231. }
  232. }
  233. // Constrain right-aligned blocks
  234. @media only screen and (min-width: 640px) {
  235. .entry-content > .alignright {
  236. margin-right: calc( 0.5 * (100% - calc( 640px - 32px)));
  237. max-width: calc( 0.5 * calc( 640px - 32px));
  238. }
  239. }
  240. // Constrain left-aligned blocks
  241. @media only screen and (min-width: 782px) {
  242. .entry-content > .wp-block-button:not(.alignleft):not(.alignright),
  243. .entry-content > .alignleft {
  244. margin-left: calc( 0.5 * (100% - calc( 782px - 32px)));
  245. max-width: calc( 0.5 * calc( 782px - 32px));
  246. }
  247. }
  248. // Constrain right-aligned blocks
  249. @media only screen and (min-width: 782px) {
  250. .entry-content > .alignright {
  251. margin-right: calc( 0.5 * (100% - calc( 782px - 32px)));
  252. max-width: calc( 0.5 * calc( 782px - 32px));
  253. }
  254. }
  255. // Constrain left-aligned blocks
  256. @media only screen and (min-width: 1024px) {
  257. .entry-content > .wp-block-button:not(.alignleft):not(.alignright),
  258. .entry-content > .alignleft {
  259. margin-left: calc( 0.5 * (100% - calc( 782px - 32px)));
  260. max-width: calc( 0.5 * calc( 782px - 32px));
  261. }
  262. }
  263. // Constrain right-aligned blocks
  264. @media only screen and (min-width: 1024px) {
  265. .entry-content > .alignright {
  266. margin-right: calc( 0.5 * (100% - calc( 782px - 32px)));
  267. max-width: calc( 0.5 * calc( 782px - 32px));
  268. }
  269. }
  270. // Constrain left-aligned blocks
  271. @media only screen and (min-width: 1280px) {
  272. .entry-content > .wp-block-button:not(.alignleft):not(.alignright),
  273. .entry-content > .alignleft {
  274. margin-left: calc( 0.5 * (100% - calc( 782px - 32px)));
  275. max-width: calc( 0.5 * calc( 782px - 32px));
  276. }
  277. }
  278. // Constrain right-aligned blocks
  279. @media only screen and (min-width: 1280px) {
  280. .entry-content > .alignright {
  281. margin-right: calc( 0.5 * (100% - calc( 782px - 32px)));
  282. max-width: calc( 0.5 * calc( 782px - 32px));
  283. }
  284. }
  285. // Cover & Hero block
  286. .wp-block-cover .wp-block-cover__inner-container,
  287. .wp-block-coblocks-hero .wp-block-coblocks-hero__box {
  288. & > * {
  289. margin-top: #{ 0.666 * map-deep-get($config-global, "spacing", "vertical") };
  290. margin-bottom: #{ 0.666 * map-deep-get($config-global, "spacing", "vertical") };
  291. @include media(mobile) {
  292. margin-top: map-deep-get($config-global, "spacing", "vertical");
  293. margin-bottom: map-deep-get($config-global, "spacing", "vertical");
  294. }
  295. &:first-child {
  296. margin-top: 0;
  297. }
  298. &:last-child {
  299. margin-bottom: 0;
  300. }
  301. }
  302. }
  303. // Table block
  304. table,
  305. .wp-block-table {
  306. td,
  307. th {
  308. border-color: #{map-deep-get($config-global, "color", "border", "default")};
  309. }
  310. }
  311. .wp-block-newspack-blocks-homepage-articles {
  312. article {
  313. .entry-title a:hover {
  314. text-decoration: none;
  315. }
  316. .cat-links a,
  317. .more-link,
  318. .entry-meta a {
  319. text-decoration: none;
  320. &:hover {
  321. text-decoration: underline;
  322. }
  323. }
  324. }
  325. &.image-alignbehind article {
  326. .entry-title a:hover {
  327. text-decoration: underline;
  328. }
  329. }
  330. }
  331. .has-background:not(.has-background-background-color),
  332. [class*="background-color"]:not(.has-background-background-color),
  333. [style*="background-color"] {
  334. .wp-block-newspack-blocks-homepage-articles article {
  335. .entry-title a:hover {
  336. text-decoration: underline;
  337. }
  338. }
  339. }
  340. /**
  341. * Hentry
  342. */
  343. // Entry Title
  344. .singular .hentry .entry-header .entry-title,
  345. .page-title {
  346. background: #{map-deep-get($config-global, "color", "background", "light")};
  347. margin-top: -#{0.5 * map-deep-get($config-global, "spacing", "vertical")};
  348. padding-bottom: #{map-deep-get($config-global, "spacing", "vertical")};
  349. padding-top: #{map-deep-get($config-global, "spacing", "vertical")};
  350. text-align: center;
  351. @include media(mobile) {
  352. margin-bottom: #{2 * map-deep-get($config-global, "spacing", "vertical")};
  353. margin-top: -#{2 * map-deep-get($config-global, "spacing", "vertical")};
  354. padding-bottom: #{2 * map-deep-get($config-global, "spacing", "vertical")};
  355. padding-top: #{2 * map-deep-get($config-global, "spacing", "vertical")};
  356. }
  357. }
  358. // Entry Meta
  359. .entry-header {
  360. .entry-meta {
  361. display: none;
  362. }
  363. }
  364. // Sticky
  365. .sticky-post,
  366. .a8c-posts-list .a8c-posts-list-item__featured span {
  367. background: #{map-deep-get($config-global, "color", "background", "light")};
  368. border-radius: #{map-deep-get($config-global, "border-radius", "sm")};
  369. color: inherit;
  370. text-transform: uppercase;
  371. }
  372. // Entry Title Link
  373. article .entry-header .entry-title,
  374. .page-title,
  375. .a8c-posts-list .a8c-posts-list-item__title,
  376. .wp-block-newspack-blocks-homepage-articles article .entry-title {
  377. a {
  378. color: inherit;
  379. text-decoration: none;
  380. &:active,
  381. &:focus,
  382. &:hover {
  383. color: #{map-deep-get($config-global, "color", "primary", "default")};
  384. }
  385. }
  386. }
  387. // Remove margin if alignfull is first element
  388. .singular {
  389. .hentry .entry-content {
  390. & > *:first-child {
  391. &.alignfull {
  392. margin-top: -#{0.666 * map-deep-get($config-global, "spacing", "vertical")};
  393. @include media(mobile) {
  394. margin-top: -#{2 * map-deep-get($config-global, "spacing", "vertical")};
  395. }
  396. }
  397. }
  398. }
  399. }
  400. .home.hide-homepage-title {
  401. .hentry .entry-content {
  402. & > *:first-child {
  403. &.alignfull {
  404. margin-top: -#{map-deep-get($config-global, "spacing", "unit")};
  405. @include media(mobile) {
  406. margin-top: -#{2 * map-deep-get($config-global, "spacing", "vertical")};
  407. }
  408. }
  409. }
  410. }
  411. }
  412. @include media(mobile) {
  413. .home.page.hide-homepage-header.hide-homepage-title .hentry .entry-content {
  414. > .wp-block-image.alignfull:first-child,
  415. > .wp-block-cover.alignfull:first-child,
  416. > .wp-block-media-text.alignfull:first-child,
  417. > .wp-block-group.has-background.alignfull:first-child {
  418. margin-top: -#{4 * map-deep-get($config-global, "spacing", "unit")};
  419. }
  420. }
  421. }
  422. /**
  423. * Comments
  424. */
  425. .comment {
  426. .avatar {
  427. border-radius: 50%;
  428. }
  429. }
  430. .comment-respond {
  431. .form-submit {
  432. display: flex;
  433. justify-content: flex-end;
  434. }
  435. }
  436. /**
  437. * Widgets
  438. */
  439. .widget-area {
  440. max-width: 100%;
  441. width: 100%;
  442. & > *:last-child {
  443. margin-bottom: #{map-deep-get($config-global, "spacing", "vertical")};
  444. }
  445. .widget-title,
  446. .widgettitle {
  447. font-size: #{map-deep-get($config-global, "font", "size", "md")};
  448. margin-bottom: #{0.5 * map-deep-get($config-global, "spacing", "vertical")};
  449. &:empty {
  450. display: none;
  451. }
  452. }
  453. @include media(laptop) {
  454. display: flex;
  455. flex-wrap: wrap;
  456. justify-content: space-between;
  457. .widget {
  458. width: calc(50% - #{map-deep-get($config-global, "spacing", "horizontal")})
  459. }
  460. & > *:nth-child(2) {
  461. margin-top: 0;
  462. }
  463. }
  464. @include media(desktop) {
  465. .widget {
  466. width: calc(33.3333% - #{1.333 * map-deep-get($config-global, "spacing", "horizontal")})
  467. }
  468. & > *:nth-child(3) {
  469. margin-top: 0;
  470. }
  471. }
  472. }
  473. .widget_calendar,
  474. .widget_calendar {
  475. caption {
  476. font-weight: bold;
  477. }
  478. td,
  479. th {
  480. text-align: center;
  481. }
  482. }
  483. .widget_archive,
  484. .widget_categories,
  485. .widget_links,
  486. .widget_meta,
  487. .widget_nav_menu,
  488. .widget_pages,
  489. .widget_recent_comments,
  490. .widget_recent_entries,
  491. .widget_rss,
  492. .widget_rss_links,
  493. .widget_top-posts,
  494. .widget_authors,
  495. .widget_jp_blogs_i_follow,
  496. .widget_top-click,
  497. .widget_upcoming_events_widget {
  498. ul {
  499. border-bottom: 1px solid map-deep-get($config-global, "color", "border", "default");
  500. list-style: none;
  501. padding-left: 0;
  502. }
  503. li {
  504. border-top: 1px solid map-deep-get($config-global, "color", "border", "default");
  505. padding: #{0.25 * map-deep-get($config-global, "spacing", "vertical")} 0;
  506. }
  507. }
  508. .widget_categories .children,
  509. .widget_nav_menu .sub-menu,
  510. .widget_pages .children {
  511. border-bottom: 0;
  512. margin-bottom: #{-0.25 * map-deep-get($config-global, "spacing", "vertical")};
  513. margin-top: #{0.25 * map-deep-get($config-global, "spacing", "vertical")};
  514. padding-left: map-deep-get($config-global, "spacing", "horizontal");
  515. }
  516. .widget_recent_entries .post-date {
  517. display: block;
  518. }
  519. .widget_rss {
  520. cite,
  521. .rssSummary,
  522. .rss-date {
  523. display: block;
  524. }
  525. }
  526. .widget_search {
  527. input[type="search"] {
  528. display: block;
  529. margin-bottom: #{0.25 * map-deep-get($config-global, "spacing", "vertical")};
  530. width: 100%;
  531. }
  532. }
  533. // Updates the Mobile Navigation to be next to the site title.
  534. @import "../../varia/sass/components/header/_site-mobile-nav-side";
  535. @include media(mobile-only) {
  536. .mobile-nav-side {
  537. #masthead .site-header-wrap > *:not(.site-logo) {
  538. margin: 0;
  539. }
  540. .site-header #site-navigation.main-navigation {
  541. .woocommerce-menu-container,
  542. .main-menu-container {
  543. background: #{map-deep-get($config-global, "color", "foreground", "default")};
  544. }
  545. }
  546. }
  547. }
  548. /**
  549. * Search block
  550. */
  551. .wp-block-search {
  552. &.wp-block-search__button-inside {
  553. .wp-block-search__inside-wrapper{
  554. border-radius: #{map-deep-get($config-button, "border-radius")};
  555. }
  556. .wp-block-search__input {
  557. background: transparent;
  558. }
  559. }
  560. .wp-block-search__input {
  561. margin-right: calc( .1 * #{map-deep-get($config-button, "padding", "horizontal")} );
  562. border-radius: #{map-deep-get($config-button, "border-radius")};
  563. }
  564. }