| @use "sass:math"; |
| @import "@automattic/typography/styles/fonts"; |
| @import "@automattic/typography/styles/variables"; |
| @import "./mixins/breakpoints"; |
|
|
| %rendered-block-content { |
| @extend %content-font; |
| margin: 0; |
| position: relative; |
| font-size: 1rem; |
| overflow-wrap: break-word; |
| word-wrap: break-word; |
|
|
| h1 { |
| font-size: $font-title-large; |
| font-weight: 700; |
| margin: 0 0 16px; |
| } |
|
|
| h2 { |
| font-size: $font-title-medium; |
| font-weight: 700; |
| margin: 0 0 8px; |
| } |
|
|
| h3 { |
| font-size: $font-title-small; |
| font-weight: 700; |
| margin: 0 0 8px; |
| } |
|
|
| h4 { |
| font-size: $font-title-small; |
| font-weight: 700; |
| margin: 0 0 8px; |
| } |
|
|
| h5 { |
| font-weight: 700; |
| } |
|
|
| p, |
| > div { |
| margin: 0 0 24px; |
|
|
| &:last-child { |
| margin-bottom: 0; |
| } |
| } |
|
|
| blockquote { |
| padding: 0 24px 0 32px; |
| margin: 16px 0 32px; |
| border-left: 3px solid var(--color-neutral-0); |
| color: var(--color-neutral-50); |
| font-weight: 400; |
| background: transparent; |
| } |
|
|
| aside { |
| margin: 0; |
| border: none; |
| background: none; |
| font-size: $font-body-small; |
| } |
|
|
| hr { |
| background: var(--color-neutral-0); |
| margin: 24px 0; |
| } |
|
|
| img { |
| max-width: 100%; |
| height: auto; |
| display: inline; |
| margin: auto; |
|
|
| &.wp-smiley { |
| height: 1em; |
| margin-bottom: 0; |
| } |
| } |
|
|
| audio, |
| video { |
| display: block; |
| width: 100%; |
| margin: 24px auto; |
| } |
|
|
| iframe[class^="twitter-"], |
| iframe[class^="instagram-"], |
| .fb_iframe_widget { |
| display: block; |
| margin: 24px auto !important; |
| } |
|
|
| @include breakpoint-deprecated( ">660px" ) { |
| .alignleft { |
| max-width: 100%; |
| float: left; |
| margin-top: 12px; |
| margin-bottom: 12px; |
| margin-right: 32px; |
| } |
|
|
| .alignright { |
| max-width: 100%; |
| float: right; |
| margin-top: 12px; |
| margin-bottom: 12px; |
| margin-left: 32px; |
| } |
| } |
|
|
| @include breakpoint-deprecated( "<660px" ) { |
| .alignleft, |
| .alignright { |
| clear: both; |
| margin-top: 24px; |
| margin-bottom: 24px; |
| } |
| } |
|
|
| .aligncenter { |
| clear: both; |
| display: block; |
| margin-top: 24px; |
| margin-bottom: 24px; |
| text-align: center; |
| } |
|
|
| .wp-caption.alignnone { |
| clear: both; |
| display: block; |
| margin-top: 24px; |
| margin-bottom: 24px; |
| } |
|
|
| .wp-caption { |
| position: relative; |
| max-width: 100%; |
|
|
| &.alignright { |
| float: right; |
| } |
|
|
| &.alignleft { |
| float: left; |
| } |
|
|
| &.alignright, |
| &.alignleft { |
| max-width: 100%; |
|
|
| @include breakpoint-deprecated( ">660px" ) { |
| max-width: 50%; |
| } |
|
|
| img.alignright, |
| img.alignleft { |
| float: none; |
| } |
| } |
|
|
| img { |
| display: block; |
| margin: 0 auto; |
| } |
| } |
|
|
| .wp-caption-text, |
| figure figcaption, |
| figure .caption, |
| .wp-caption .wp-media-credit { |
| padding: 12px; |
| margin: 0; |
| font-size: $font-body-small; |
| text-align: center; |
| color: var(--color-neutral-40); |
| } |
|
|
| |
| .video-plh-notice { |
| position: relative; |
| margin-bottom: 24px; |
| padding: 11px 24px; |
| border-radius: 2px; |
| background: var(--color-neutral-0); |
| box-sizing: border-box; |
| font-size: $font-body-small; |
| line-height: 1.4285; |
| animation: appear 0.3s ease-in-out; |
|
|
| @include breakpoint-deprecated( ">660px" ) { |
| padding: 13px 48px; |
| font-size: inherit; |
| } |
| } |
|
|
| sup, |
| sub { |
| vertical-align: baseline; |
| position: relative; |
| font-size: 0.875rem; |
| } |
|
|
| sup { |
| top: -0.4em; |
| } |
|
|
| sub { |
| bottom: -0.2em; |
| } |
|
|
| table th, |
| table td { |
| padding: 10px; |
| } |
|
|
| img:first-child { |
| margin-top: 0; |
| } |
|
|
| |
| .wp-block-image, |
| .wp-block-embed { |
| margin-bottom: 1em; |
| } |
|
|
| .wp-block-gallery { |
| margin-left: 0; |
| margin-bottom: 1em; |
| |
| &:not(.is-cropped) { |
| .blocks-gallery-item { |
| align-self: flex-start; |
| } |
| } |
| } |
|
|
| .blocks-gallery-caption { |
| margin: auto; |
| } |
|
|
| .wp-block-buttons { |
| margin: 0; |
| } |
|
|
| .wp-block-button { |
| border-style: solid; |
| font-family: $sans; |
| border-width: 1px; |
| cursor: pointer; |
| display: inline-block; |
| margin: 0; |
| margin-right: 0.25em; |
| margin-bottom: 0.6em; |
| outline: 0; |
| overflow: hidden; |
| vertical-align: top; |
| font-size: 0.875rem; |
| font-weight: 600; |
| line-height: 22px; |
| border-radius: 2px; |
| padding: 8px 14px; |
| border-color: var(--color-neutral-10); |
| } |
|
|
| .wp-block-table table { |
| border-collapse: collapse; |
| } |
|
|
| .wp-block-table td, |
| .wp-block-table th { |
| border: 1px solid var(--color-neutral-10); |
| font-size: 1rem; |
| line-height: 1.8; |
| } |
|
|
| .wp-block-table th { |
| font-weight: bold; |
| background: var(--color-neutral-0); |
| } |
|
|
| .wp-block-button__link, |
| .wp-block-button__link:hover { |
| color: inherit; |
| } |
|
|
| $grid-size-large: 16px; |
| $default-font-size: $font-body-small; |
| $content-width: 610px; |
| $break-small: 600px; |
| $black: #000; |
| $white: #fff; |
|
|
| @mixin break-small() { |
| @media (min-width: #{ ($break-small) }) { |
| @content; |
| } |
| } |
| |
| |
| .wp-block-gallery, |
| .blocks-gallery-grid { |
| display: flex; |
| flex-wrap: wrap; |
| list-style-type: none; |
| padding: 0; |
| |
| margin: 0; |
|
|
| .blocks-gallery-image, |
| .blocks-gallery-item { |
| |
| margin: 0 1em 1em 0; |
| display: flex; |
| flex-grow: 1; |
| flex-direction: column; |
| justify-content: center; |
| position: relative; |
|
|
| |
| width: calc(50% - 1em); |
|
|
| &:nth-of-type(even) { |
| margin-right: 0; |
| } |
|
|
| figure { |
| margin: 0; |
| height: 100%; |
| display: flex; |
| align-items: flex-end; |
| justify-content: flex-start; |
| } |
|
|
| img { |
| display: block; |
| max-width: 100%; |
| height: auto; |
| width: auto; |
| } |
|
|
| figcaption { |
| position: absolute; |
| bottom: 0; |
| width: 100%; |
| max-height: 100%; |
| overflow: auto; |
| padding: 3em 0.77em 0.7em; |
| color: $white; |
| text-align: center; |
| font-size: 0.875rem; |
| background: linear-gradient(0deg, rgba($color: $black, $alpha: 0.7) 0, rgba($color: $black, $alpha: 0.3) 70%, transparent); |
| box-sizing: border-box; |
| margin: 0; |
| z-index: 2; |
| img { |
| display: inline; |
| } |
| } |
| } |
|
|
| figcaption { |
| flex-grow: 1; |
| } |
|
|
| |
| &.is-cropped .blocks-gallery-image, |
| &.is-cropped .blocks-gallery-item { |
| a, |
| img { |
| width: 100%; |
| height: 100%; |
| flex: 1; |
| object-fit: cover; |
| } |
| } |
|
|
| &.columns-1 .blocks-gallery-image, |
| &.columns-1 .blocks-gallery-item { |
| width: 100%; |
| margin-right: 0; |
| } |
|
|
| |
| @include break-small { |
| @for $i from 3 through 8 { |
| &.columns-#{ $i } .blocks-gallery-image, |
| &.columns-#{ $i } .blocks-gallery-item { |
| width: calc(#{math.div( 100%, $i )} - #{math.div( 1em * ( $i - 1 ), $i )}); |
| margin-right: 1em; |
| } |
| } |
|
|
| |
| @for $column-count from 1 through 8 { |
| &.columns-#{ $column-count } .blocks-gallery-image:nth-of-type( #{ $column-count }n ), |
| &.columns-#{ $column-count } .blocks-gallery-item:nth-of-type( #{ $column-count }n ) { |
| margin-right: 0; |
| } |
| } |
| } |
|
|
| |
| .blocks-gallery-image:last-child, |
| .blocks-gallery-item:last-child { |
| margin-right: 0; |
| } |
|
|
| |
| &.alignleft, |
| &.alignright { |
| max-width: $content-width * 0.5; |
| width: 100%; |
| } |
|
|
| |
| &.aligncenter { |
| .blocks-gallery-item figure { |
| justify-content: center; |
| } |
| } |
| } |
|
|
| |
| |
| $grid-unit-20: 16px; |
| .wp-block-gallery.has-nested-images { |
| display: flex; |
| flex-wrap: wrap; |
| |
| |
| figure.wp-block-image:not(.wp-gallery-individual-image) { |
| |
| margin: |
| 0 var(--gallery-block--gutter-size, #{$grid-unit-20}) |
| var(--gallery-block--gutter-size, #{$grid-unit-20}) 0; |
|
|
| &:last-of-type:not(.wp-gallery-individual-image) { |
| margin-right: 0; |
| } |
|
|
| width: calc(50% - ( var(--gallery-block--gutter-size, #{$grid-unit-20}) / 2 )); |
|
|
| &:nth-of-type(even) { |
| margin-right: 0; |
| } |
| } |
|
|
| figure.wp-block-image { |
| display: flex; |
| flex-grow: 1; |
| justify-content: center; |
| position: relative; |
| margin-top: auto; |
| margin-bottom: auto; |
| flex-direction: column; |
|
|
| > div, |
| > a { |
| margin: 0; |
| flex-direction: column; |
| flex-grow: 1; |
| } |
|
|
| img { |
| display: block; |
| height: auto; |
| max-width: 100%; |
| width: auto; |
| } |
|
|
| figcaption { |
| background: linear-gradient(0deg, rgba($color: $black, $alpha: 0.7) 0, rgba($color: $black, $alpha: 0.3) 70%, transparent); |
| bottom: 0; |
| color: $white; |
| font-size: $default-font-size; |
| left: 0; |
| margin-bottom: 0; |
| max-height: 60%; |
| overflow: auto; |
| padding: 0 8px 8px; |
| position: absolute; |
| text-align: center; |
| width: 100%; |
| box-sizing: border-box; |
|
|
| img { |
| display: inline; |
| } |
| } |
|
|
| &.is-style-rounded { |
| > div, |
| > a { |
| flex: 1 1 auto; |
| } |
| figcaption { |
| flex: initial; |
| background: none; |
| color: inherit; |
| margin: 0; |
| padding: 10px 10px 9px; |
| position: relative; |
| } |
| } |
| } |
|
|
| figcaption { |
| flex-grow: 1; |
| flex-basis: 100%; |
| text-align: center; |
| } |
|
|
| |
| &:not(.is-cropped) { |
| figure.wp-block-image:not(.wp-gallery-individual-image) { |
| margin-top: 0; |
| margin-bottom: auto; |
| img { |
| margin-bottom: var(--gallery-block--gutter-size, #{$grid-unit-20}); |
| } |
|
|
| figcaption { |
| bottom: var(--gallery-block--gutter-size, #{$grid-unit-20}); |
| } |
| } |
| } |
|
|
| |
| &.is-cropped figure.wp-block-image:not(.wp-gallery-individual-image) { |
| align-self: inherit; |
| > div:not(.components-drop-zone), |
| > a { |
| display: flex; |
| } |
|
|
| a, |
| img { |
| width: 100%; |
| flex: 1 0 0%; |
| height: 100%; |
| object-fit: cover; |
| } |
| } |
|
|
| &.columns-1 figure.wp-block-image:not(.wp-gallery-individual-image) { |
| margin-right: 0; |
| width: 100%; |
| } |
|
|
| |
| @include break-small { |
| @for $i from 3 through 8 { |
| &.columns-#{ $i } figure.wp-block-image:not( .wp-gallery-individual-image ) { |
| margin-right: var(--gallery-block--gutter-size, #{$grid-unit-20}); |
| width: |
| calc(#{math.div( 100%, $i )} - |
| ( var(--gallery-block--gutter-size, #{$grid-unit-20}) * #{math.div( $i - 1, $i )} )); |
| } |
|
|
| |
| &.columns-#{$i} |
| figure.wp-block-image:not( .wp-gallery-individual-image ).is-dragging |
| ~ figure.wp-block-image:not( .wp-gallery-individual-image ) { |
| margin-right: var(--gallery-block--gutter-size, #{$grid-unit-20}); |
| } |
| } |
| |
| @for $column-count from 1 through 8 { |
| &.columns-#{$column-count} |
| figure.wp-block-image:not( .wp-gallery-individual-image ):nth-of-type( #{ $column-count }n ) { |
| margin-right: 0; |
| } |
| } |
| |
| &.columns-default { |
| figure.wp-block-image:not(.wp-gallery-individual-image) { |
| margin-right: var(--gallery-block--gutter-size, #{$grid-unit-20}); |
| width: calc(33.33% - ( var(--gallery-block--gutter-size, 16px) * #{math.div( 2, 3 )} )); |
| } |
| figure.wp-block-image:not(.wp-gallery-individual-image):nth-of-type(3n + 3) { |
| margin-right: 0; |
| } |
| |
| figure.wp-block-image:not(.wp-gallery-individual-image):first-child:nth-last-child(2), |
| figure.wp-block-image:not(.wp-gallery-individual-image):first-child:nth-last-child(2) ~ figure.wp-block-image:not(.wp-gallery-individual-image) { |
| width: calc(50% - ( var(--gallery-block--gutter-size, 16px) * 0.5 )); |
| } |
| |
| figure.wp-block-image:not(.wp-gallery-individual-image):first-child:nth-last-child(1) { |
| width: 100%; |
| } |
| } |
| } |
|
|
| |
| &.alignleft, |
| &.alignright { |
| max-width: $content-width * 0.5; |
| width: 100%; |
| } |
|
|
| |
| &.aligncenter { |
| justify-content: center; |
| } |
| } |
|
|
| .wp-block-embed .embed-vimeo { |
| padding-top: 0; |
| margin-bottom: 1.4em; |
| } |
|
|
| .wp-block-cover-image { |
| display: none; |
| } |
|
|
| |
| .wp-block-embed__wrapper iframe[src*="icloud.com"] { |
| min-height: 300px; |
| } |
| } |
|
|