_extra-child-theme.scss 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  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. .site-logo {
  103. grid-area: site-logo;
  104. margin-bottom: #{map-deep-get($config-global, "spacing", "unit")};
  105. }
  106. .site-title {
  107. align-self: flex-end;
  108. grid-area: site-title;
  109. & + .site-description {
  110. margin-top: 0;
  111. }
  112. }
  113. .site-description {
  114. align-self: center;
  115. grid-area: site-description;
  116. }
  117. .main-navigation {
  118. align-self: center;
  119. grid-area: main-navigation;
  120. justify-self: flex-end;
  121. & > div > ul {
  122. justify-content: flex-end;
  123. & > .menu-item-has-children > a::after {
  124. font-size: #{0.5 * map-deep-get($config-global, "font", "size", "base")};
  125. }
  126. }
  127. & > div > ul > li:hover,
  128. & > div > ul > li.focus,
  129. & > div > ul > li.current-menu-item {
  130. & > a {
  131. color: rgba(map-deep-get($config-global, "color", "background", "default"), 0.8);
  132. }
  133. & > ul {
  134. background: #{map-deep-get($config-global, "color", "foreground", "default")};
  135. border: 1px solid #{map-deep-get($config-global, "color", "foreground", "dark")};
  136. border-radius: #{map-deep-get($config-global, "border-radius", "sm")};
  137. overflow: hidden;
  138. }
  139. & li {
  140. border-top: 1px solid #{map-deep-get($config-global, "color", "foreground", "dark")};
  141. &:first-child {
  142. border-top: 0;
  143. }
  144. & > a {
  145. background: #{map-deep-get($config-global, "color", "foreground", "default")};
  146. color: #{map-deep-get($config-global, "color", "background", "default")};
  147. padding: #{0.5 * map-deep-get($config-global, "spacing", "unit")} #{1.5 * map-deep-get($config-global, "spacing", "unit")};
  148. }
  149. &:hover > a,
  150. &.focus > a,
  151. &.current-menu-item > a {
  152. background: #{map-deep-get($config-global, "color", "primary", "default")};
  153. }
  154. }
  155. }
  156. & > div > ul > li.current-menu-item {
  157. & > a {
  158. color: inherit;
  159. box-shadow: 0 2px 0;
  160. }
  161. }
  162. }
  163. .social-navigation {
  164. align-self: center;
  165. grid-area: social-navigation;
  166. justify-self: flex-end;
  167. }
  168. }
  169. }
  170. // Social Menu
  171. .social-navigation {
  172. & > div > ul {
  173. flex-wrap: wrap;
  174. }
  175. }
  176. /**
  177. * Header
  178. */
  179. #masthead {
  180. background: #{map-deep-get($config-global, "color", "foreground", "default")};
  181. & > * {
  182. position: relative;
  183. }
  184. }
  185. // Site Title
  186. .site-description {
  187. color: #{map-deep-get($config-header, "branding", "color", "text")};
  188. }
  189. /**
  190. * Main
  191. */
  192. @include media(mobile) {
  193. #main {
  194. padding-top: #{2 * map-deep-get($config-global, "spacing", "vertical")};
  195. }
  196. }
  197. /**
  198. * Footer
  199. */
  200. // Footer Menu
  201. .footer-navigation .footer-menu {
  202. a {
  203. font-size: #{map-deep-get($config-global, "font", "size", "xs")};
  204. line-height: #{map-deep-get($config-global, "font", "line-height", "xs")};
  205. }
  206. }
  207. /**
  208. * Blocks
  209. */
  210. // Add space for floated content
  211. @media only screen and (min-width: 560px) {
  212. .entry-content > .wp-block-button:not(.alignleft):not(.alignright),
  213. .entry-content > .alignleft {
  214. margin-right: #{map-deep-get($config-global, "spacing", "horizontal")};
  215. }
  216. .entry-content > .alignright {
  217. margin-left: #{map-deep-get($config-global, "spacing", "horizontal")};
  218. }
  219. }
  220. // Constrain left-aligned blocks
  221. @media only screen and (min-width: 640px) {
  222. .entry-content > .wp-block-button:not(.alignleft):not(.alignright),
  223. .entry-content > .alignleft {
  224. margin-left: calc( 0.5 * (100% - calc( 640px - 32px)));
  225. max-width: calc( 0.5 * calc( 782px - 32px));
  226. }
  227. }
  228. // Constrain right-aligned blocks
  229. @media only screen and (min-width: 640px) {
  230. .entry-content > .alignright {
  231. margin-right: calc( 0.5 * (100% - calc( 640px - 32px)));
  232. max-width: calc( 0.5 * calc( 640px - 32px));
  233. }
  234. }
  235. // Constrain left-aligned blocks
  236. @media only screen and (min-width: 782px) {
  237. .entry-content > .wp-block-button:not(.alignleft):not(.alignright),
  238. .entry-content > .alignleft {
  239. margin-left: calc( 0.5 * (100% - calc( 782px - 32px)));
  240. max-width: calc( 0.5 * calc( 782px - 32px));
  241. }
  242. }
  243. // Constrain right-aligned blocks
  244. @media only screen and (min-width: 782px) {
  245. .entry-content > .alignright {
  246. margin-right: calc( 0.5 * (100% - calc( 782px - 32px)));
  247. max-width: calc( 0.5 * calc( 782px - 32px));
  248. }
  249. }
  250. // Constrain left-aligned blocks
  251. @media only screen and (min-width: 1024px) {
  252. .entry-content > .wp-block-button:not(.alignleft):not(.alignright),
  253. .entry-content > .alignleft {
  254. margin-left: calc( 0.5 * (100% - calc( 782px - 32px)));
  255. max-width: calc( 0.5 * calc( 782px - 32px));
  256. }
  257. }
  258. // Constrain right-aligned blocks
  259. @media only screen and (min-width: 1024px) {
  260. .entry-content > .alignright {
  261. margin-right: calc( 0.5 * (100% - calc( 782px - 32px)));
  262. max-width: calc( 0.5 * calc( 782px - 32px));
  263. }
  264. }
  265. // Constrain left-aligned blocks
  266. @media only screen and (min-width: 1280px) {
  267. .entry-content > .wp-block-button:not(.alignleft):not(.alignright),
  268. .entry-content > .alignleft {
  269. margin-left: calc( 0.5 * (100% - calc( 782px - 32px)));
  270. max-width: calc( 0.5 * calc( 782px - 32px));
  271. }
  272. }
  273. // Constrain right-aligned blocks
  274. @media only screen and (min-width: 1280px) {
  275. .entry-content > .alignright {
  276. margin-right: calc( 0.5 * (100% - calc( 782px - 32px)));
  277. max-width: calc( 0.5 * calc( 782px - 32px));
  278. }
  279. }
  280. // Cover & Hero block
  281. .wp-block-cover .wp-block-cover__inner-container,
  282. .wp-block-coblocks-hero .wp-block-coblocks-hero__box {
  283. & > * {
  284. margin-top: #{ 0.666 * map-deep-get($config-global, "spacing", "vertical") };
  285. margin-bottom: #{ 0.666 * map-deep-get($config-global, "spacing", "vertical") };
  286. @include media(mobile) {
  287. margin-top: map-deep-get($config-global, "spacing", "vertical");
  288. margin-bottom: map-deep-get($config-global, "spacing", "vertical");
  289. }
  290. &:first-child {
  291. margin-top: 0;
  292. }
  293. &:last-child {
  294. margin-bottom: 0;
  295. }
  296. }
  297. }
  298. // Table block
  299. table,
  300. .wp-block-table {
  301. td,
  302. th {
  303. border-color: #{map-deep-get($config-global, "color", "border", "default")};
  304. }
  305. }
  306. .wp-block-newspack-blocks-homepage-articles {
  307. article {
  308. .entry-title a:hover {
  309. text-decoration: none;
  310. }
  311. .cat-links a,
  312. .more-link,
  313. .entry-meta a {
  314. text-decoration: none;
  315. &:hover {
  316. text-decoration: underline;
  317. }
  318. }
  319. }
  320. &.image-alignbehind article {
  321. .entry-title a:hover {
  322. text-decoration: underline;
  323. }
  324. }
  325. }
  326. .has-background:not(.has-background-background-color),
  327. [class*="background-color"]:not(.has-background-background-color),
  328. [style*="background-color"] {
  329. .wp-block-newspack-blocks-homepage-articles article {
  330. .entry-title a:hover {
  331. text-decoration: underline;
  332. }
  333. }
  334. }
  335. /**
  336. * Hentry
  337. */
  338. // Entry Title
  339. .singular .hentry .entry-header .entry-title,
  340. .page-title {
  341. background: #{map-deep-get($config-global, "color", "background", "light")};
  342. margin-top: -#{0.5 * map-deep-get($config-global, "spacing", "vertical")};
  343. padding-bottom: #{map-deep-get($config-global, "spacing", "vertical")};
  344. padding-top: #{map-deep-get($config-global, "spacing", "vertical")};
  345. text-align: center;
  346. @include media(mobile) {
  347. margin-bottom: #{2 * map-deep-get($config-global, "spacing", "vertical")};
  348. margin-top: -#{2 * map-deep-get($config-global, "spacing", "vertical")};
  349. padding-bottom: #{2 * map-deep-get($config-global, "spacing", "vertical")};
  350. padding-top: #{2 * map-deep-get($config-global, "spacing", "vertical")};
  351. }
  352. }
  353. // Entry Meta
  354. .entry-header {
  355. .entry-meta {
  356. display: none;
  357. }
  358. }
  359. // Sticky
  360. .sticky-post,
  361. .a8c-posts-list .a8c-posts-list-item__featured span {
  362. background: #{map-deep-get($config-global, "color", "background", "light")};
  363. border-radius: #{map-deep-get($config-global, "border-radius", "sm")};
  364. color: inherit;
  365. text-transform: uppercase;
  366. }
  367. // Entry Title Link
  368. article .entry-header .entry-title,
  369. .page-title,
  370. .a8c-posts-list .a8c-posts-list-item__title,
  371. .wp-block-newspack-blocks-homepage-articles article .entry-title {
  372. a {
  373. color: inherit;
  374. text-decoration: none;
  375. &:active,
  376. &:focus,
  377. &:hover {
  378. color: #{map-deep-get($config-global, "color", "primary", "default")};
  379. }
  380. }
  381. }
  382. // Remove margin if alignfull is first element
  383. .singular {
  384. .hentry .entry-content {
  385. & > *:first-child {
  386. &.alignfull {
  387. margin-top: -#{0.666 * map-deep-get($config-global, "spacing", "vertical")};
  388. @include media(mobile) {
  389. margin-top: -#{2 * map-deep-get($config-global, "spacing", "vertical")};
  390. }
  391. }
  392. }
  393. }
  394. }
  395. .home.hide-homepage-title {
  396. .hentry .entry-content {
  397. & > *:first-child {
  398. &.alignfull {
  399. margin-top: -#{map-deep-get($config-global, "spacing", "unit")};
  400. @include media(mobile) {
  401. margin-top: -#{2 * map-deep-get($config-global, "spacing", "vertical")};
  402. }
  403. }
  404. }
  405. }
  406. }
  407. /**
  408. * Comments
  409. */
  410. .comment {
  411. .avatar {
  412. border-radius: 50%;
  413. }
  414. }
  415. .comment-respond {
  416. .form-submit {
  417. display: flex;
  418. justify-content: flex-end;
  419. }
  420. }
  421. /**
  422. * Widgets
  423. */
  424. .widget-area {
  425. max-width: 100%;
  426. width: 100%;
  427. & > *:last-child {
  428. margin-bottom: #{map-deep-get($config-global, "spacing", "vertical")};
  429. }
  430. .widget-title,
  431. .widgettitle {
  432. font-size: #{map-deep-get($config-global, "font", "size", "md")};
  433. margin-bottom: #{0.5 * map-deep-get($config-global, "spacing", "vertical")};
  434. &:empty {
  435. display: none;
  436. }
  437. }
  438. @include media(laptop) {
  439. display: flex;
  440. flex-wrap: wrap;
  441. justify-content: space-between;
  442. .widget {
  443. width: calc(50% - #{map-deep-get($config-global, "spacing", "horizontal")})
  444. }
  445. & > *:nth-child(2) {
  446. margin-top: 0;
  447. }
  448. }
  449. @include media(desktop) {
  450. .widget {
  451. width: calc(33.3333% - #{1.333 * map-deep-get($config-global, "spacing", "horizontal")})
  452. }
  453. & > *:nth-child(3) {
  454. margin-top: 0;
  455. }
  456. }
  457. }
  458. .widget_calendar,
  459. .widget_calendar {
  460. caption {
  461. font-weight: bold;
  462. }
  463. td,
  464. th {
  465. text-align: center;
  466. }
  467. }
  468. .widget_archive,
  469. .widget_categories,
  470. .widget_links,
  471. .widget_meta,
  472. .widget_nav_menu,
  473. .widget_pages,
  474. .widget_recent_comments,
  475. .widget_recent_entries,
  476. .widget_rss,
  477. .widget_rss_links,
  478. .widget_top-posts,
  479. .widget_authors,
  480. .widget_jp_blogs_i_follow,
  481. .widget_top-click,
  482. .widget_upcoming_events_widget {
  483. ul {
  484. border-bottom: 1px solid map-deep-get($config-global, "color", "border", "default");
  485. list-style: none;
  486. padding-left: 0;
  487. }
  488. li {
  489. border-top: 1px solid map-deep-get($config-global, "color", "border", "default");
  490. padding: #{0.25 * map-deep-get($config-global, "spacing", "vertical")} 0;
  491. }
  492. }
  493. .widget_categories .children,
  494. .widget_nav_menu .sub-menu,
  495. .widget_pages .children {
  496. border-bottom: 0;
  497. margin-bottom: #{-0.25 * map-deep-get($config-global, "spacing", "vertical")};
  498. margin-top: #{0.25 * map-deep-get($config-global, "spacing", "vertical")};
  499. padding-left: map-deep-get($config-global, "spacing", "horizontal");
  500. }
  501. .widget_recent_entries .post-date {
  502. display: block;
  503. }
  504. .widget_rss {
  505. cite,
  506. .rssSummary,
  507. .rss-date {
  508. display: block;
  509. }
  510. }
  511. .widget_search {
  512. input[type="search"] {
  513. display: block;
  514. margin-bottom: #{0.25 * map-deep-get($config-global, "spacing", "vertical")};
  515. width: 100%;
  516. }
  517. }