aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/nav/nav-link/nav-link.module.scss
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-10-02 18:45:30 +0200
committerArmand Philippot <git@armandphilippot.com>2023-11-11 18:14:41 +0100
commitf914ff8376dd91c4f6f8ca149e1cb6becb622d88 (patch)
tree777dc0268eba86721878a715c68f0f09bedb4b18 /src/components/molecules/nav/nav-link/nav-link.module.scss
parentb52b8183ce299b5a2d3c3b2f4f8cb94bb443d746 (diff)
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
Diffstat (limited to 'src/components/molecules/nav/nav-link/nav-link.module.scss')
-rw-r--r--src/components/molecules/nav/nav-link/nav-link.module.scss61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/components/molecules/nav/nav-link/nav-link.module.scss b/src/components/molecules/nav/nav-link/nav-link.module.scss
new file mode 100644
index 0000000..8a7d371
--- /dev/null
+++ b/src/components/molecules/nav/nav-link/nav-link.module.scss
@@ -0,0 +1,61 @@
+@use "../../../../styles/abstracts/functions" as fun;
+@use "../../../../styles/abstracts/placeholders";
+
+.link {
+ --draw-border-thickness: #{fun.convert-px(4)};
+ --draw-border-color1: var(--color-primary-light);
+ --draw-border-color2: var(--color-primary-lighter);
+
+ display: flex;
+ flex-flow: row wrap;
+ place-items: center;
+ place-content: center;
+ row-gap: var(--spacing-2xs);
+ min-width: var(--link-min-width, fun.convert-px(80));
+ padding: var(--spacing-xs) var(--spacing-xs) var(--spacing-2xs);
+ background: none;
+ border-radius: 8%;
+ font-size: var(--font-size-sm);
+ font-variant: small-caps;
+ font-weight: 600;
+ text-align: center;
+ text-decoration: none;
+
+ &--inline {
+ width: fit-content;
+
+ .logo {
+ margin-right: var(--spacing-xs);
+ }
+ }
+
+ &--stack {
+ .logo {
+ flex: 0 0 100%;
+ display: flex;
+ place-content: center;
+ }
+ }
+
+ &:hover,
+ &:focus {
+ @extend %draw-borders;
+ }
+
+ &:hover {
+ color: var(--color-primary-light);
+ }
+
+ &:focus {
+ color: var(--color-primary-light);
+ }
+
+ &:active {
+ --draw-border-color1: var(--color-primary-dark);
+ --draw-border-color2: var(--color-primary-light);
+
+ color: var(--color-primary-dark);
+
+ @extend %draw-borders;
+ }
+}