From f914ff8376dd91c4f6f8ca149e1cb6becb622d88 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 2 Oct 2023 18:45:30 +0200 Subject: refactor(components): rewrite Link component * rename `external` prop to `isExternal` * rename `download` prop to `isDownload` * rewrite CSS to reduce code length and complexity * move link styles in Sass placeholders to avoid repeats because of WordPress articles * move NavLink component to molecules --- src/components/atoms/links/link.module.scss | 220 ---------------------------- 1 file changed, 220 deletions(-) delete mode 100644 src/components/atoms/links/link.module.scss (limited to 'src/components/atoms/links/link.module.scss') diff --git a/src/components/atoms/links/link.module.scss b/src/components/atoms/links/link.module.scss deleted file mode 100644 index 4980a1c..0000000 --- a/src/components/atoms/links/link.module.scss +++ /dev/null @@ -1,220 +0,0 @@ -@use "../../../styles/abstracts/functions" as fun; -@use "../../../styles/abstracts/variables" as var; - -/* stylelint-disable no-descending-specificity */ -.link { - &[hreflang] { - &::after { - display: inline-block; - - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0[" attr(hreflang) "]"; - font-size: var(--font-size-sm); - } - } - - &--download { - &::after { - display: inline-block; - - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0" url(fun.encode-svg('')); - } - - &:focus:not(:active)::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0" url(fun.encode-svg('')); - } - - &[hreflang] { - &::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('')); - } - - &:focus:not(:active)::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('')); - } - } - } - - &--external { - &::after { - display: inline-block; - - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0" url(fun.encode-svg('')); - } - - &:focus:not(:active)::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0" url(fun.encode-svg('')); - } - - &[hreflang] { - &::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('')); - } - - &:focus:not(:active)::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('')); - } - } - } - - &--external#{&}--download { - &::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0" url(fun.encode-svg('')) "\0000a0" url(fun.encode-svg('')); - } - - &:focus:not(:active)::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0" url(fun.encode-svg('')) "\0000a0" url(fun.encode-svg('')); - } - - &[hreflang] { - &::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('')) "\0000a0" url(fun.encode-svg('')); - } - - &:focus:not(:active)::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('')) "\0000a0" url(fun.encode-svg('')); - } - } - } -} - -:global([data-theme="dark"]) { - :local { - .link { - &--download { - &::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0" url(fun.encode-svg('')); - } - - &:focus:not(:active)::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0" url(fun.encode-svg('')); - } - - &[hreflang] { - &::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('')); - } - - &:focus:not(:active)::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('')); - } - } - } - - &--external { - &::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0" url(fun.encode-svg('')); - } - - &:focus:not(:active)::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0" url(fun.encode-svg('')); - } - - &[hreflang] { - &::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('')); - } - - &:focus:not(:active)::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('')); - } - } - } - - &--external.link--download { - &::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0" url(fun.encode-svg('')) "\0000a0" url(fun.encode-svg('')); - } - - &:focus:not(:active)::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0" url(fun.encode-svg('')) "\0000a0" url(fun.encode-svg('')); - } - - &[hreflang] { - &::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('')) "\0000a0" url(fun.encode-svg('')); - } - - &:focus:not(:active)::after { - /* Prettier is removing spacing between content parts. */ - - /* prettier-ignore */ - content: "\0000a0[" attr(hreflang) "]\0000a0" url(fun.encode-svg('')) "\0000a0" url(fun.encode-svg('')); - } - } - } - } - } -} -/* stylelint-enable no-descending-specificity */ -- cgit v1.2.3