From 67380230e4e34304261a1b0b2aa2d2c3b8137b18 Mon Sep 17 00:00:00 2001 From: Aline Date: Wed, 10 Jan 2024 15:44:30 +0100 Subject: [PATCH 1/3] Create variant for link with 'btn' class --- assets/components/atoms/link/link-button.twig | 2 ++ assets/components/atoms/link/link.scss | 11 +++++++++++ assets/components/atoms/link/link.yml | 6 ++++++ 3 files changed, 19 insertions(+) create mode 100644 assets/components/atoms/link/link-button.twig diff --git a/assets/components/atoms/link/link-button.twig b/assets/components/atoms/link/link-button.twig new file mode 100644 index 00000000..581e5fb0 --- /dev/null +++ b/assets/components/atoms/link/link-button.twig @@ -0,0 +1,2 @@ +Primary button link +Secondary button link diff --git a/assets/components/atoms/link/link.scss b/assets/components/atoms/link/link.scss index 3fad2bee..ff372c83 100644 --- a/assets/components/atoms/link/link.scss +++ b/assets/components/atoms/link/link.scss @@ -120,3 +120,14 @@ a:visited { opacity: 1; } } + +// Button link + +a.btn, +a.btn-primary { + color: $white; +} + +a.btn-secondary { + color: $black; +} diff --git a/assets/components/atoms/link/link.yml b/assets/components/atoms/link/link.yml index 55f486ca..b6920ecc 100644 --- a/assets/components/atoms/link/link.yml +++ b/assets/components/atoms/link/link.yml @@ -25,3 +25,9 @@ variants: - name: login title: Login link notes: + - name: button + title: Button link + notes: | + Use the classes `btn`, `btn-primary` or `btn-secondary` to create a link with the look of a button. + + ⚠️ Button links should be used to target a page or section of a page – like a regular link. To trigger an action, use an [HTML button](#/atoms/button). From 6564e5060b2bb00a72e32a57033d888b97cdf042 Mon Sep 17 00:00:00 2001 From: Aline Date: Wed, 7 Feb 2024 11:28:00 +0100 Subject: [PATCH 2/3] Remove base styles for :visited links Revert changes of PR #694 (https://github.com/epfl-si/elements/pull/694) --- assets/components/atoms/link/link.scss | 17 +---------------- .../molecules/pagination/pagination.scss | 5 +++++ 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/assets/components/atoms/link/link.scss b/assets/components/atoms/link/link.scss index ff372c83..e3e73ab6 100644 --- a/assets/components/atoms/link/link.scss +++ b/assets/components/atoms/link/link.scss @@ -1,11 +1,7 @@ @charset 'utf-8'; // All links are underlined by default. Supported browsers will have the right color. https://caniuse.com/#feat=text-decoration -a, -a:visited { - color: $black; - text-decoration: underline; - background-color: transparent; +a { text-decoration-color: $link-hover-color; transition: text-decoration-color 0.2s ease-in-out, @@ -120,14 +116,3 @@ a:visited { opacity: 1; } } - -// Button link - -a.btn, -a.btn-primary { - color: $white; -} - -a.btn-secondary { - color: $black; -} diff --git a/assets/components/molecules/pagination/pagination.scss b/assets/components/molecules/pagination/pagination.scss index e18fb4ad..148e1e5d 100644 --- a/assets/components/molecules/pagination/pagination.scss +++ b/assets/components/molecules/pagination/pagination.scss @@ -43,6 +43,11 @@ } } +.page-link, +.page-link:visited { + color: $red; +} + .page-link { display: inline-flex; justify-content: center; From af932dd83b8d9775d442634034773ab4e57d7395 Mon Sep 17 00:00:00 2001 From: Aline Date: Fri, 9 Feb 2024 12:16:02 +0100 Subject: [PATCH 3/3] Remove styles for .page-link:visited --- assets/components/molecules/pagination/pagination.scss | 5 ----- 1 file changed, 5 deletions(-) diff --git a/assets/components/molecules/pagination/pagination.scss b/assets/components/molecules/pagination/pagination.scss index 148e1e5d..e18fb4ad 100644 --- a/assets/components/molecules/pagination/pagination.scss +++ b/assets/components/molecules/pagination/pagination.scss @@ -43,11 +43,6 @@ } } -.page-link, -.page-link:visited { - color: $red; -} - .page-link { display: inline-flex; justify-content: center;