diff options
Diffstat (limited to 'src/styles/pages/partials')
| -rw-r--r-- | src/styles/pages/partials/_article-headings.scss | 57 | ||||
| -rw-r--r-- | src/styles/pages/partials/_article-links.scss | 204 | ||||
| -rw-r--r-- | src/styles/pages/partials/_article-lists.scss | 65 | ||||
| -rw-r--r-- | src/styles/pages/partials/_article-media.scss | 20 | ||||
| -rw-r--r-- | src/styles/pages/partials/_article-prism.scss | 302 | ||||
| -rw-r--r-- | src/styles/pages/partials/_article-wp-blocks.scss | 177 | 
6 files changed, 825 insertions, 0 deletions
| diff --git a/src/styles/pages/partials/_article-headings.scss b/src/styles/pages/partials/_article-headings.scss new file mode 100644 index 0000000..c0c3519 --- /dev/null +++ b/src/styles/pages/partials/_article-headings.scss @@ -0,0 +1,57 @@ +@use "@styles/abstracts/functions" as fun; + +@mixin styles { +  h1 { +    font-size: var(--font-size-3xl); +    font-weight: 500; +  } + +  h2 { +    padding-bottom: fun.convert-px(3); +    background: linear-gradient( +        to top, +        var(--color-primary-dark) 0.3rem, +        transparent 0.3rem +      ) +      0 0 / 3rem 100% no-repeat; +    font-size: var(--font-size-2xl); +    font-weight: 500; +    text-shadow: fun.convert-px(1) fun.convert-px(1) 0 var(--color-shadow-light); +  } + +  h3 { +    font-size: var(--font-size-xl); +    font-weight: 500; +  } + +  h4 { +    font-size: var(--font-size-lg); +    font-weight: 500; +  } + +  h5 { +    font-size: var(--font-size-md); +    font-weight: 600; +  } + +  h6 { +    font-size: var(--font-size-md); +    font-weight: 500; +  } + +  h1, +  h2, +  h3, +  h4, +  h5, +  h6 { +    color: var(--color-primary-dark); +    font-family: var(--font-family-secondary); +    letter-spacing: 0.01ex; +    margin: 0 0 var(--spacing-sm); + +    & + & { +      margin-top: var(--spacing-md); +    } +  } +} diff --git a/src/styles/pages/partials/_article-links.scss b/src/styles/pages/partials/_article-links.scss new file mode 100644 index 0000000..543337a --- /dev/null +++ b/src/styles/pages/partials/_article-links.scss @@ -0,0 +1,204 @@ +@use "@styles/abstracts/functions" as fun; +@use "@styles/abstracts/variables" as var; + +@mixin styles { +  a { +    &[hreflang] { +      &::after { +        display: inline-block; + +        /* Prettier is removing spacing between content parts. */ + +        /* prettier-ignore */ +        content: "\0000a0[" attr(hreflang) "]"; +        font-size: var(--font-size-sm); +      } +    } +  } + +  /* stylelint-disable no-descending-specificity */ +  a.download { +    &::after { +      display: inline-block; + +      /* Prettier is removing spacing between content parts. */ + +      /* prettier-ignore */ +      content: "\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$light-theme_blue}" d="m49 80.048-28.445-30.77 19.32 4.095V5.06h18.252v48.313l21.318-4.095z"/><path fill="#{var.$light-theme_blue}" d="M0 67.57v27.37h100V67.57H87.973v15.344H12.027V67.569z"/></svg>')); +    } + +    &:focus:not(:active)::after { +      /* Prettier is removing spacing between content parts. */ + +      /* prettier-ignore */ +      content: "\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$light-theme_white}" d="m49 80.048-28.445-30.77 19.32 4.095V5.06h18.252v48.313l21.318-4.095z"/><path fill="#{var.$light-theme_white}" d="M0 67.57v27.37h100V67.57H87.973v15.344H12.027V67.569z"/></svg>')); +    } + +    &[hreflang] { +      &::after { +        /* Prettier is removing spacing between content parts. */ + +        /* prettier-ignore */ +        content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$light-theme_blue}" d="m49 80.048-28.445-30.77 19.32 4.095V5.06h18.252v48.313l21.318-4.095z"/><path fill="#{var.$light-theme_blue}" d="M0 67.57v27.37h100V67.57H87.973v15.344H12.027V67.569z"/></svg>')); +      } +    } +  } + +  a.external { +    &::after { +      display: inline-block; + +      /* Prettier is removing spacing between content parts. */ + +      /* prettier-ignore */ +      content: "\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$light-theme_blue}" d="M100 0 59.543 5.887l20.8 6.523-51.134 51.134 7.249 7.248L87.59 19.66l6.522 20.798z"/><path fill="#{var.$light-theme_blue}" d="M4 10a4 4 0 0 0-4 4v82a4 4 0 0 0 4 4h82a4 4 0 0 0 4-4V62.314h-8V92H8V18h29.686v-8z"/></svg>')); +    } + +    &:focus:not(:active)::after { +      /* Prettier is removing spacing between content parts. */ + +      /* prettier-ignore */ +      content: "\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$light-theme_white}" d="M100 0 59.543 5.887l20.8 6.523-51.134 51.134 7.249 7.248L87.59 19.66l6.522 20.798z"/><path fill="#{var.$light-theme_white}" d="M4 10a4 4 0 0 0-4 4v82a4 4 0 0 0 4 4h82a4 4 0 0 0 4-4V62.314h-8V92H8V18h29.686v-8z"/></svg>')); +    } + +    &[hreflang] { +      &::after { +        /* Prettier is removing spacing between content parts. */ + +        /* prettier-ignore */ +        content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$light-theme_blue}" d="M100 0 59.543 5.887l20.8 6.523-51.134 51.134 7.249 7.248L87.59 19.66l6.522 20.798z"/><path fill="#{var.$light-theme_blue}" d="M4 10a4 4 0 0 0-4 4v82a4 4 0 0 0 4 4h82a4 4 0 0 0 4-4V62.314h-8V92H8V18h29.686v-8z"/></svg>')); +      } + +      &:focus:not(:active)::after { +        /* Prettier is removing spacing between content parts. */ + +        /* prettier-ignore */ +        content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$light-theme_white}" d="M100 0 59.543 5.887l20.8 6.523-51.134 51.134 7.249 7.248L87.59 19.66l6.522 20.798z"/><path fill="#{var.$light-theme_white}" d="M4 10a4 4 0 0 0-4 4v82a4 4 0 0 0 4 4h82a4 4 0 0 0 4-4V62.314h-8V92H8V18h29.686v-8z"/></svg>')); +      } +    } +  } + +  a.external.download { +    &::after { +      /* Prettier is removing spacing between content parts. */ + +      /* prettier-ignore */ +      content: "\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$light-theme_blue}" d="m49 80.048-28.445-30.77 19.32 4.095V5.06h18.252v48.313l21.318-4.095z"/><path fill="#{var.$light-theme_blue}" d="M0 67.57v27.37h100V67.57H87.973v15.344H12.027V67.569z"/></svg>')) "\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$light-theme_blue}" d="M100 0 59.543 5.887l20.8 6.523-51.134 51.134 7.249 7.248L87.59 19.66l6.522 20.798z"/><path fill="#{var.$light-theme_blue}" d="M4 10a4 4 0 0 0-4 4v82a4 4 0 0 0 4 4h82a4 4 0 0 0 4-4V62.314h-8V92H8V18h29.686v-8z"/></svg>')); +    } + +    &[hreflang] { +      &::after { +        /* Prettier is removing spacing between content parts. */ + +        /* prettier-ignore */ +        content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$light-theme_blue}" d="m49 80.048-28.445-30.77 19.32 4.095V5.06h18.252v48.313l21.318-4.095z"/><path fill="#{var.$light-theme_blue}" d="M0 67.57v27.37h100V67.57H87.973v15.344H12.027V67.569z"/></svg>')) "\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$light-theme_blue}" d="M100 0 59.543 5.887l20.8 6.523-51.134 51.134 7.249 7.248L87.59 19.66l6.522 20.798z"/><path fill="#{var.$light-theme_blue}" d="M4 10a4 4 0 0 0-4 4v82a4 4 0 0 0 4 4h82a4 4 0 0 0 4-4V62.314h-8V92H8V18h29.686v-8z"/></svg>')); +      } + +      &:focus:not(:active)::after { +        /* Prettier is removing spacing between content parts. */ + +        /* prettier-ignore */ +        content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$light-theme_blue}" d="m49 80.048-28.445-30.77 19.32 4.095V5.06h18.252v48.313l21.318-4.095z"/><path fill="#{var.$light-theme_blue}" d="M0 67.57v27.37h100V67.57H87.973v15.344H12.027V67.569z"/></svg>')) "\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$light-theme_white}" d="M100 0 59.543 5.887l20.8 6.523-51.134 51.134 7.249 7.248L87.59 19.66l6.522 20.798z"/><path fill="#{var.$light-theme_white}" d="M4 10a4 4 0 0 0-4 4v82a4 4 0 0 0 4 4h82a4 4 0 0 0 4-4V62.314h-8V92H8V18h29.686v-8z"/></svg>')); +      } +    } +  } + +  [data-theme="dark"] { +    a.download { +      &::after { +        /* Prettier is removing spacing between content parts. */ + +        /* prettier-ignore */ +        content: "\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$dark-theme_blue}" d="m49 80.048-28.445-30.77 19.32 4.095V5.06h18.252v48.313l21.318-4.095z"/><path fill="#{var.$dark-theme_blue}" d="M0 67.57v27.37h100V67.57H87.973v15.344H12.027V67.569z"/></svg>')); +      } + +      &:focus:not(:active)::after { +        /* Prettier is removing spacing between content parts. */ + +        /* prettier-ignore */ +        content: "\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$dark-theme_black}" d="m49 80.048-28.445-30.77 19.32 4.095V5.06h18.252v48.313l21.318-4.095z"/><path fill="#{var.$dark-theme_black}" d="M0 67.57v27.37h100V67.57H87.973v15.344H12.027V67.569z"/></svg>')); +      } + +      &[hreflang] { +        &::after { +          /* Prettier is removing spacing between content parts. */ + +          /* prettier-ignore */ +          content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$dark-theme_blue}" d="m49 80.048-28.445-30.77 19.32 4.095V5.06h18.252v48.313l21.318-4.095z"/><path fill="#{var.$dark-theme_blue}" d="M0 67.57v27.37h100V67.57H87.973v15.344H12.027V67.569z"/></svg>')); +        } + +        &:focus:not(:active)::after { +          /* Prettier is removing spacing between content parts. */ + +          /* prettier-ignore */ +          content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$dark-theme_black}" d="m49 80.048-28.445-30.77 19.32 4.095V5.06h18.252v48.313l21.318-4.095z"/><path fill="#{var.$dark-theme_black}" d="M0 67.57v27.37h100V67.57H87.973v15.344H12.027V67.569z"/></svg>')); +        } +      } +    } + +    a.external { +      &::after { +        /* Prettier is removing spacing between content parts. */ + +        /* prettier-ignore */ +        content: "\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$dark-theme_blue}" d="M100 0 59.543 5.887l20.8 6.523-51.134 51.134 7.249 7.248L87.59 19.66l6.522 20.798z"/><path fill="#{var.$dark-theme_blue}" d="M4 10a4 4 0 0 0-4 4v82a4 4 0 0 0 4 4h82a4 4 0 0 0 4-4V62.314h-8V92H8V18h29.686v-8z"/></svg>')); +      } + +      &:focus:not(:active)::after { +        /* Prettier is removing spacing between content parts. */ + +        /* prettier-ignore */ +        content: "\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$dark-theme_black}" d="M100 0 59.543 5.887l20.8 6.523-51.134 51.134 7.249 7.248L87.59 19.66l6.522 20.798z"/><path fill="#{var.$dark-theme_black}" d="M4 10a4 4 0 0 0-4 4v82a4 4 0 0 0 4 4h82a4 4 0 0 0 4-4V62.314h-8V92H8V18h29.686v-8z"/></svg>')); +      } + +      &[hreflang] { +        &::after { +          /* Prettier is removing spacing between content parts. */ + +          /* prettier-ignore */ +          content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$dark-theme_blue}" d="M100 0 59.543 5.887l20.8 6.523-51.134 51.134 7.249 7.248L87.59 19.66l6.522 20.798z"/><path fill="#{var.$dark-theme_blue}" d="M4 10a4 4 0 0 0-4 4v82a4 4 0 0 0 4 4h82a4 4 0 0 0 4-4V62.314h-8V92H8V18h29.686v-8z"/></svg>')); +        } + +        &:focus:not(:active)::after { +          /* Prettier is removing spacing between content parts. */ + +          /* prettier-ignore */ +          content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$dark-theme_black}" d="M100 0 59.543 5.887l20.8 6.523-51.134 51.134 7.249 7.248L87.59 19.66l6.522 20.798z"/><path fill="#{var.$dark-theme_black}" d="M4 10a4 4 0 0 0-4 4v82a4 4 0 0 0 4 4h82a4 4 0 0 0 4-4V62.314h-8V92H8V18h29.686v-8z"/></svg>')); +        } +      } +    } + +    a.external.download { +      &::after { +        /* Prettier is removing spacing between content parts. */ + +        /* prettier-ignore */ +        content: "\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$dark-theme_blue}" d="m49 80.048-28.445-30.77 19.32 4.095V5.06h18.252v48.313l21.318-4.095z"/><path fill="#{var.$dark-theme_blue}" d="M0 67.57v27.37h100V67.57H87.973v15.344H12.027V67.569z"/></svg>')) "\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$dark-theme_blue}" d="M100 0 59.543 5.887l20.8 6.523-51.134 51.134 7.249 7.248L87.59 19.66l6.522 20.798z"/><path fill="#{var.$dark-theme_blue}" d="M4 10a4 4 0 0 0-4 4v82a4 4 0 0 0 4 4h82a4 4 0 0 0 4-4V62.314h-8V92H8V18h29.686v-8z"/></svg>')); +      } + +      &:focus:not(:active)::after { +        /* Prettier is removing spacing between content parts. */ + +        /* prettier-ignore */ +        content: "\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$dark-theme_black}" d="m49 80.048-28.445-30.77 19.32 4.095V5.06h18.252v48.313l21.318-4.095z"/><path fill="#{var.$dark-theme_black}" d="M0 67.57v27.37h100V67.57H87.973v15.344H12.027V67.569z"/></svg>')) "\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$dark-theme_black}" d="M100 0 59.543 5.887l20.8 6.523-51.134 51.134 7.249 7.248L87.59 19.66l6.522 20.798z"/><path fill="#{var.$dark-theme_black}" d="M4 10a4 4 0 0 0-4 4v82a4 4 0 0 0 4 4h82a4 4 0 0 0 4-4V62.314h-8V92H8V18h29.686v-8z"/></svg>')); +      } + +      &[hreflang] { +        &::after { +          /* Prettier is removing spacing between content parts. */ + +          /* prettier-ignore */ +          content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$dark-theme_blue}" d="m49 80.048-28.445-30.77 19.32 4.095V5.06h18.252v48.313l21.318-4.095z"/><path fill="#{var.$dark-theme_blue}" d="M0 67.57v27.37h100V67.57H87.973v15.344H12.027V67.569z"/></svg>')) "\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$dark-theme_blue}" d="M100 0 59.543 5.887l20.8 6.523-51.134 51.134 7.249 7.248L87.59 19.66l6.522 20.798z"/><path fill="#{var.$dark-theme_blue}" d="M4 10a4 4 0 0 0-4 4v82a4 4 0 0 0 4 4h82a4 4 0 0 0 4-4V62.314h-8V92H8V18h29.686v-8z"/></svg>')); +        } + +        &:focus:not(:active)::after { +          /* Prettier is removing spacing between content parts. */ + +          /* prettier-ignore */ +          content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$dark-theme_black}" d="m49 80.048-28.445-30.77 19.32 4.095V5.06h18.252v48.313l21.318-4.095z"/><path fill="#{var.$dark-theme_black}" d="M0 67.57v27.37h100V67.57H87.973v15.344H12.027V67.569z"/></svg>')) "\0000a0" url(fun.encode-svg('<svg width="13" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="#{var.$dark-theme_black}" d="M100 0 59.543 5.887l20.8 6.523-51.134 51.134 7.249 7.248L87.59 19.66l6.522 20.798z"/><path fill="#{var.$dark-theme_black}" d="M4 10a4 4 0 0 0-4 4v82a4 4 0 0 0 4 4h82a4 4 0 0 0 4-4V62.314h-8V92H8V18h29.686v-8z"/></svg>')); +        } +      } +    } +  } +} +/* stylelint-enable no-descending-specificity */ diff --git a/src/styles/pages/partials/_article-lists.scss b/src/styles/pages/partials/_article-lists.scss new file mode 100644 index 0000000..c0084b0 --- /dev/null +++ b/src/styles/pages/partials/_article-lists.scss @@ -0,0 +1,65 @@ +@mixin styles { +  ol { +    padding: 0; +    list-style-type: none; +    counter-reset: li; + +    > li { +      display: table; +      counter-increment: li; + +      &::before { +        content: counters(li, ".") ". "; +        display: table-cell; +        padding-right: var(--spacing-2xs); +        color: var(--color-secondary); +      } +    } + +    li ol > li::before { +      content: counters(li, ".") ". "; +    } +  } + +  ul, +  ol { +    li:not(:last-child) { +      margin-bottom: var(--spacing-2xs); +    } + +    ::marker { +      color: var(--color-primary-dark); +    } +  } + +  ul { +    padding-left: var(--spacing-sm); +  } + +  dl { +    display: flex; +    flex-flow: row wrap; +    gap: var(--spacing-2xs); +    width: fit-content; +  } + +  ul, +  ol, +  dl { +    margin: var(--spacing-sm) 0; + +    & & { +      margin: var(--spacing-2xs) 0 0; +    } +  } + +  dt { +    color: var(--color-fg-light); +    font-weight: 600; +  } + +  dd { +    margin: 0; +    word-break: break-all; +  } +} diff --git a/src/styles/pages/partials/_article-media.scss b/src/styles/pages/partials/_article-media.scss new file mode 100644 index 0000000..0cd3654 --- /dev/null +++ b/src/styles/pages/partials/_article-media.scss @@ -0,0 +1,20 @@ +@use "@styles/abstracts/functions" as fun; + +@mixin styles { +  figure { +    display: flex; +    flex-flow: column; +    width: fit-content; +    margin: 0 auto; +    position: relative; +    text-align: center; +  } + +  figcaption { +    margin: 0; +    padding: fun.convert-px(4) var(--spacing-2xs); +    background: var(--color-bg-secondary); +    border: fun.convert-px(1) solid var(--color-border-light); +    font-weight: 500; +  } +} diff --git a/src/styles/pages/partials/_article-prism.scss b/src/styles/pages/partials/_article-prism.scss new file mode 100644 index 0000000..a714eb6 --- /dev/null +++ b/src/styles/pages/partials/_article-prism.scss @@ -0,0 +1,302 @@ +@use "@styles/abstracts/functions" as fun; +@use "@styles/abstracts/mixins" as mix; + +@mixin styles { +  .code-toolbar { +    --toolbar-height: #{fun.convert-px(100)}; + +    position: relative; +    margin-top: calc(var(--toolbar-height) + var(--spacing-sm)); + +    @include mix.media("screen") { +      @include mix.dimensions("2xs") { +        --toolbar-height: #{fun.convert-px(60)}; +      } +    } + +    .toolbar { +      display: flex; +      flex-flow: row wrap; +      justify-content: center; +      width: 100%; +      height: var(--toolbar-height); +      position: absolute; +      top: calc(var(--toolbar-height) * -1); +      left: 0; +      right: 0; +      background: var(--color-bg-tertiary); +      border: fun.convert-px(1) solid var(--color-border); +    } + +    .toolbar-item { +      display: flex; +      align-items: center; +      margin: 0 var(--spacing-2xs); +    } + +    .toolbar-item:nth-child(1) { +      flex: 0 0 100%; +      justify-content: center; +      margin: 0 auto 0 0; +      padding: 0 var(--spacing-sm); +      background: var(--color-bg-code); +      border-bottom: fun.convert-px(1) solid var(--color-border); +      color: var(--color-primary-darker); +      font-size: var(--font-size-sm); +      font-weight: 600; + +      @include mix.media("screen") { +        @include mix.dimensions("2xs") { +          flex: 0 0 auto; +          justify-content: left; +          border-bottom: none; +          border-right: fun.convert-px(1) solid var(--color-border); +        } +      } +    } +  } + +  .copy-to-clipboard-button, +  .prism-color-scheme-button { +    display: block; +    padding: fun.convert-px(3) var(--spacing-xs); +    background: var(--color-bg); +    border: 0.4ex solid var(--color-primary); +    border-radius: fun.convert-px(30); +    box-shadow: fun.convert-px(1) fun.convert-px(1) fun.convert-px(1) +        var(--color-shadow), +      fun.convert-px(1) fun.convert-px(2) fun.convert-px(2) fun.convert-px(-2) +        var(--color-shadow), +      fun.convert-px(3) fun.convert-px(4) fun.convert-px(5) fun.convert-px(-4) +        var(--color-shadow); +    color: var(--color-primary); +    font-size: var(--font-size-sm); +    font-weight: 600; +    transition: all 0.35s ease-in-out 0s; + +    &:hover, +    &:focus { +      transform: translateX(#{fun.convert-px(-2)}) +        translateY(#{fun.convert-px(-2)}); +      box-shadow: fun.convert-px(1) fun.convert-px(1) fun.convert-px(1) +          var(--color-shadow-light), +        fun.convert-px(1) fun.convert-px(2) fun.convert-px(2) fun.convert-px(-2) +          var(--color-shadow-light), +        fun.convert-px(3) fun.convert-px(4) fun.convert-px(5) fun.convert-px(-4) +          var(--color-shadow-light), +        fun.convert-px(4) fun.convert-px(7) fun.convert-px(8) fun.convert-px(-3) +          var(--color-shadow-light); +    } + +    &:focus { +      text-decoration: underline var(--color-primary) fun.convert-px(3); +    } + +    &:active { +      text-decoration: none; +      transform: translateY(#{fun.convert-px(2)}); +      box-shadow: 0 0 0 0 var(--color-shadow); +    } +  } + +  pre[class*="language-"] { +    --gutter-size-with-spacing: calc(var(--gutter-size) + var(--spacing-xs)); + +    padding: 0; +    position: relative; +    overflow: auto; +    border: fun.convert-px(1) solid var(--color-border-light); +    hyphens: none; +    tab-size: 4; +    text-align: left; +    white-space: pre; +    word-spacing: normal; +    word-break: normal; +    word-wrap: normal; + +    &.command-line { +      --gutter-size: 19ch; +      padding-left: var(--gutter-size-with-spacing); +    } + +    &.line-numbers { +      --gutter-size: 6ch; + +      counter-reset: lineNumber; +      padding-left: var(--gutter-size-with-spacing); +    } + +    code { +      display: block; +      padding: var(--spacing-xs) 0; +      position: relative; +    } + +    .line-numbers-rows, +    .command-line-prompt { +      display: block; +      width: var(--gutter-size); +      padding: var(--spacing-xs) 0; +      position: absolute; +      top: 0; +      left: calc(var(--gutter-size-with-spacing) * -1); +      background: var(--color-bg); +      border-right: fun.convert-px(1) solid var(--color-border); +      font-size: 100%; +      letter-spacing: -1px; +      text-align: right; +      pointer-events: none; +      user-select: none; + +      > span { +        &::before { +          display: block; +          padding-right: var(--spacing-xs); +          color: var(--color-fg-light); +        } +      } +    } + +    .command-line-prompt { +      > span { +        &::before { +          content: " "; +        } + +        &[data-user]::before { +          content: "[" attr(data-user) "@" attr(data-host) "] $"; +        } + +        &[data-user="root"]::before { +          content: "[" attr(data-user) "@" attr(data-host) "] #"; +        } + +        &[data-prompt]::before { +          content: attr(data-prompt); +        } + +        &[data-continuation-prompt]::before { +          content: attr(data-continuation-prompt); +        } +      } +    } + +    .line-numbers-rows { +      > span { +        counter-increment: lineNumber; + +        &::before { +          content: counter(lineNumber); +        } +      } +    } + +    .token { +      &.comment, +      &.doc-comment { +        color: var(--color-fg-light); +      } + +      &.punctuation { +        color: var(--color-fg); +      } + +      &.attr-name, +      &.hexcode, +      &.inserted, +      &.string { +        color: var(--color-token-green); +      } + +      &.class, +      &.coord, +      &.id, +      &.function { +        color: var(--color-token-purple); +      } + +      &.builtin, +      &.builtin.class-name, +      &.property-access, +      &.regex, +      &.scope { +        color: var(--color-token-magenta); +      } + +      &.class-name, +      &.constant, +      &.global, +      &.interpolation, +      &.key, +      &.package, +      &.this, +      &.title, +      &.variable { +        color: var(--color-token-blue); +      } + +      &.combinator, +      &.keyword, +      &.operator, +      &.pseudo-class, +      &.pseudo-element, +      &.rule, +      &.selector, +      &.unit { +        color: var(--color-token-orange); +      } + +      &.attr-value, +      &.boolean, +      &.number { +        color: var(--color-token-yellow); +      } + +      &.delimiter, +      &.doctype, +      &.parameter, +      &.parent, +      &.property, +      &.shebang, +      &.tag { +        color: var(--color-token-cyan); +      } + +      &.deleted { +        color: var(--color-token-red); +      } + +      &.punctuation.brace-hover, +      &.punctuation.brace-selected { +        background: var(--color-bg); +        outline: solid fun.convert-px(1) var(--color-primary-light); +      } +    } + +    span.inline-color-wrapper { +      background: url(fun.encode-svg( +        '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 2"><path fill="gray" d="M0 0h2v2H0z"/><path fill="white" d="M0 0h1v1H0zM1 1h1v1H1z"/></svg>' +      )); + +      /* Prevent glitches where 1px from the repeating pattern could be seen. */ +      background-position: center; +      background-size: 110%; + +      display: inline-block; +      height: 1.1ch; +      width: 1.1ch; +      margin: 0 0.5ch 0 0; +      border: fun.convert-px(1) solid var(--color-bg); +      outline: fun.convert-px(1) solid var(--color-border-dark); +      overflow: hidden; +    } + +    span.inline-color { +      display: block; + +      /* To prevent visual glitches again */ +      height: 120%; +      width: 120%; +    } +  } +} diff --git a/src/styles/pages/partials/_article-wp-blocks.scss b/src/styles/pages/partials/_article-wp-blocks.scss new file mode 100644 index 0000000..86be062 --- /dev/null +++ b/src/styles/pages/partials/_article-wp-blocks.scss @@ -0,0 +1,177 @@ +@use "@styles/abstracts/functions" as fun; +@use "@styles/abstracts/mixins" as mix; +@use "@styles/abstracts/placeholders"; + +@mixin styles { +  .wp-block-quote { +    margin: var(--spacing-sm) 0; +    padding: var(--spacing-sm); +    position: relative; +    border: fun.convert-px(1) solid var(--color-border-dark); +    border-left: fun.convert-px(5) solid var(--color-border-dark); +    box-shadow: fun.convert-px(1) fun.convert-px(1) fun.convert-px(1) 0 +        var(--color-shadow), +      fun.convert-px(3) fun.convert-px(3) fun.convert-px(4) 0 +        var(--color-shadow); +    font-style: italic; + +    > *:last-child { +      margin: 0; +    } + +    cite { +      color: var(--color-fg-light); +      font-size: var(--font-size-sm); +      font-style: normal; +      font-weight: 600; +    } +  } + +  .wp-block-code, +  .wp-block-preformatted { +    padding: var(--spacing-xs) var(--spacing-sm); +    background: var(--color-bg-secondary); +    border: fun.convert-px(1) solid var(--color-border-light); +    color: var(--color-fg); +  } + +  .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-image, +  .wp-block-video { +    padding: fun.convert-px(4); +    border: fun.convert-px(1) solid var(--color-border); +    box-shadow: fun.convert-px(1) fun.convert-px(1) fun.convert-px(1) 0 +      var(--color-shadow); +  } + +  .wp-block-image { +    display: flex; +    flex-flow: column; +    width: fit-content; +    margin: 0 auto; +    position: relative; +    text-align: center; + +    img { +      margin: auto; +    } + +    figcaption { +      margin-top: fun.convert-px(4); +      font-size: var(--font-size-sm); +    } +  } + +  .wp-block-gallery { +    display: grid; +    grid-template-columns: minmax(0, 1fr); +    gap: var(--spacing-sm); + +    .blocks-gallery-grid { +      @extend %reset-list; + +      grid-column: 1 / -1; +      grid-row: 1 / -1; +      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), +          fun.convert-px(2) fun.convert-px(2) fun.convert-px(2) 0 +            var(--color-shadow-light), +          fun.convert-px(3) fun.convert-px(3) fun.convert-px(6) 0 +            var(--color-shadow-light); + +        &:hover, +        &:focus { +          transform: scale(1.05); +          box-shadow: 0 0 fun.convert-px(1) 0 var(--color-shadow), +            fun.convert-px(3) fun.convert-px(3) fun.convert-px(2) 0 +              var(--color-shadow-light), +            fun.convert-px(5) fun.convert-px(5) fun.convert-px(8) 0 +              var(--color-shadow-light); +        } + +        &:focus { +          outline: solid var(--color-primary-light); +        } + +        &:active { +          transform: scale(0.95); +          box-shadow: 0 0 fun.convert-px(1) 0 var(--color-shadow), +            fun.convert-px(2) fun.convert-px(2) fun.convert-px(2) 0 +              var(--color-shadow-light), +            0 0 0 0 var(--color-shadow-light); +          outline: none; +        } +      } +    } + +    &.aligncenter { +      .blocks-gallery-grid { +        align-items: center; +      } +    } + +    @for $i from 0 to 6 { +      &.columns-#{$i} { +        @include mix.media("screen") { +          @include mix.dimensions("xs") { +            grid-template-columns: repeat(2, minmax(0, 1fr)); + +            .blocks-gallery-grid { +              grid-template-columns: repeat(2, minmax(0, 1fr)); +            } +          } + +          @include mix.dimensions("sm") { +            grid-template-columns: repeat(#{$i}, minmax(0, 1fr)); + +            .blocks-gallery-grid { +              grid-template-columns: repeat(3, minmax(0, 1fr)); +            } +          } +        } +      } +    } + +    .wp-block-image img { +      height: 100%; +      object-fit: cover; +    } +  } +} | 
