diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-01-03 12:56:19 +0100 | 
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-01-03 13:10:51 +0100 | 
| commit | f9276790f55bd9d528512e6fe647774b67860dd0 (patch) | |
| tree | e58511298f7c51bc48a182342d8ffea0e907a2df /src/styles/components | |
| parent | 04a1ceb257311a98fffc4b18679f73789b920e09 (diff) | |
chore: add styles to WP blocks
Diffstat (limited to 'src/styles/components')
| -rw-r--r-- | src/styles/components/_wp-blocks.scss | 159 | 
1 files changed, 159 insertions, 0 deletions
| diff --git a/src/styles/components/_wp-blocks.scss b/src/styles/components/_wp-blocks.scss new file mode 100644 index 0000000..4d21893 --- /dev/null +++ b/src/styles/components/_wp-blocks.scss @@ -0,0 +1,159 @@ +@use "@styles/abstracts/functions" as fun; +@use "@styles/abstracts/mixins" as mix; +@use "@styles/abstracts/placeholders"; + +.wp-block-quote { +  margin: var(--spacing-sm) 0; +  padding: var(--spacing-sm); +  position: relative; +  border: fun.convert-px(1) solid var(--color-primary-lighter); +  border-left: fun.convert-px(5) solid var(--color-primary-lighter); +  box-shadow: 0 0 fun.convert-px(1) 0 var(--color-shadow-light), +    fun.convert-px(2) fun.convert-px(2) fun.convert-px(2) 0 +      var(--color-shadow-lighter), +    fun.convert-px(3) fun.convert-px(3) fun.convert-px(6) 0 +      var(--color-shadow-lighter); +  font-style: italic; + +  > *:last-child { +    margin: 0; +  } + +  cite { +    font-size: var(--font-size-sm); +    font-style: normal; +    font-weight: 600; +  } +} + +.wp-block-code, +.wp-block-preformatted { +  margin: 0 auto var(--spacing-md); +  padding: var(--spacing-xs) var(--spacing-sm); +  background: var(--color-bg-secondary); +  border: fun.convert-px(1) solid var(--color-border-lighter); +  color: var(--color-primary-darker); +} + +.wp-block-code[class*="language-"] { +  margin: var(--spacing-sm) 0; +  padding: 0 var(--spacing-sm); +} + +.wp-block-columns { +  display: grid; +  grid-template-columns: minmax(0, 1fr); +  gap: var(--spacing-md); +  margin: var(--spacing-md) 0; + +  @include mix.media("screen") { +    @include mix.dimensions("sm") { +      grid-template-columns: repeat(2, minmax(0, 1fr)); +    } +  } + +  &.are-vertically-aligned-center { +    align-items: center; +  } +} + +.wp-block-column { +  > *:first-child { +    margin-top: 0; +  } + +  > *:last-child { +    margin-bottom: 0; +  } +} + +.wp-block-gallery { +  .blocks-gallery-grid { +    @extend %reset-list; + +    display: grid; +    grid-template-columns: minmax(0, 1fr); +    gap: var(--spacing-sm); +  } + +  .blocks-gallery-item { +    figure { +      margin: 0; +    } + +    a { +      display: block; +      box-shadow: 0 0 fun.convert-px(1) 0 var(--color-shadow-light), +        fun.convert-px(2) fun.convert-px(2) fun.convert-px(2) 0 +          var(--color-shadow-lighter), +        fun.convert-px(3) fun.convert-px(3) fun.convert-px(6) 0 +          var(--color-shadow-lighter); + +      &:hover, +      &:focus { +        transform: scale(1.05); +        box-shadow: 0 0 fun.convert-px(1) 0 var(--color-shadow-light), +          fun.convert-px(3) fun.convert-px(3) fun.convert-px(2) 0 +            var(--color-shadow-lighter), +          fun.convert-px(5) fun.convert-px(5) fun.convert-px(8) 0 +            var(--color-shadow-lighter); +      } + +      &:focus { +        outline: solid var(--color-primary-light); +      } + +      &:active { +        transform: scale(0.95); +        box-shadow: 0 0 fun.convert-px(1) 0 var(--color-shadow-light), +          fun.convert-px(2) fun.convert-px(2) fun.convert-px(2) 0 +            var(--color-shadow-lighter), +          0 0 0 0 var(--color-shadow-lighter); +        outline: none; +      } +    } +  } + +  &.aligncenter { +    .blocks-gallery-grid { +      align-items: center; +    } +  } + +  @include mix.media("screen") { +    @include mix.dimensions("sm") { +      &.columns-2 { +        .blocks-gallery-grid { +          grid-template-columns: repeat(2, minmax(0, 1fr)); +        } +      } + +      &.columns-3 { +        .blocks-gallery-grid { +          grid-template-columns: repeat(3, minmax(0, 1fr)); +        } +      } +    } +  } +} + +.wp-block-image { +  img { +    display: block; +    margin: auto; +    box-shadow: 0 0 fun.convert-px(1) 0 var(--color-shadow-light), +      fun.convert-px(2) fun.convert-px(2) fun.convert-px(2) 0 +        var(--color-shadow-lighter), +      fun.convert-px(3) fun.convert-px(3) fun.convert-px(6) 0 +        var(--color-shadow-lighter); +    text-align: center; +  } +} + +.wp-block-video { +  box-shadow: 0 0 fun.convert-px(1) 0 var(--color-shadow-light), +    fun.convert-px(2) fun.convert-px(2) fun.convert-px(2) 0 +      var(--color-shadow-lighter), +    fun.convert-px(3) fun.convert-px(3) fun.convert-px(6) 0 +      var(--color-shadow-lighter); +} | 
