Skip to content

Commit

Permalink
Fork the secondary-button-link style to develop a new link styling #3342
Browse files Browse the repository at this point in the history
  • Loading branch information
giorgiosironi committed Jun 21, 2024
1 parent 15e3deb commit 3dc984e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
11 changes: 11 additions & 0 deletions src/read-side/html-pages/search-page/_index.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
@use 'sass:color';
@use 'button';
@use 'functions';
@use 'list';
@use 'settings';

.search-categories {
@include list.basics();
display: flex;
flex-flow: row wrap;
gap: functions.px-to-rem(32px);
}

.search-categories__link {
@include button.link(
$text: settings.$colour-text-primary,
$background: settings.$colour-background-grey,
$background-hover: color.adjust(settings.$colour-background-grey, $lightness: -12%),
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ViewModel } from '../view-model';

const renderSearchCategories = (viewModel: ViewModel) => pipe(
viewModel,
RA.map((category) => toHtmlFragment(`<a href="${category.href}">${category.title}</a>`)),
RA.map((category) => toHtmlFragment(`<a href="${category.href}" class="search-categories__link">${category.title}</a>`)),
renderListItems,
(categories) => `
<section>
Expand Down
6 changes: 3 additions & 3 deletions src/read-side/html-pages/shared-sass/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@use 'settings';
@use 'typography';

@mixin _link($text, $background, $background-hover) {
@mixin link($text, $background, $background-hover) {
@include typography.button();

display: inline-block;
Expand Down Expand Up @@ -61,7 +61,7 @@
}

@mixin primary-link {
@include _link(
@include link(
$text: settings.$colour-white,
$background: settings.$colour-accent,
$background-hover: settings.$colour-accent-hover,
Expand All @@ -77,7 +77,7 @@
}

@mixin secondary-link() {
@include _link(
@include link(
$text: settings.$colour-text-primary,
$background: settings.$colour-background-grey,
$background-hover: color.adjust(settings.$colour-background-grey, $lightness: -12%),
Expand Down

0 comments on commit 3dc984e

Please sign in to comment.