Skip to content

Commit

Permalink
Merge pull request #454 from sitevision/ENV-307-buttons-in-pagination
Browse files Browse the repository at this point in the history
ENV-307 support buttons in pagination
  • Loading branch information
henrikekelof authored Sep 9, 2024
2 parents e0ecd4e + 6bb1d22 commit 5401620
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions packages/envision-docs/src/pages/components/pagination.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ Use `aria-current="page"` or `aria-current="true"` on a link to indicate that th

### Disabled

An element without href attribute is considered disabled. If you must use a link, remove the href attribute
and set the `aria-disabled="true"` and `aria-role="link"` attributes.
Any element except button without a href attribute is considered disabled. Buttons are disabled using the disabled attribute.
If you must use a link, remove the href attribute and set the `aria-disabled="true"` and `aria-role="link"` attributes.

```html
<nav aria-label="Pagination example">
Expand Down
25 changes: 13 additions & 12 deletions packages/envision/src/scss/pagination.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,14 @@
border-color: css-var('element-primary-background-color');
}

// env-is-disabled is deprecated
&[href=''],
&:not([href]),
&.env-is-disabled {
@include is-disabled();
&:hover {
background-color: css-var('element-primary-background-color');
border-color: css-var('element-primary-background-color');
color: css-var('element-primary-font-color');
z-index: 2;
}
}

&__link:hover {
background-color: css-var('element-primary-background-color');
border-color: css-var('element-primary-background-color');
color: css-var('element-primary-font-color');
z-index: 2;
}

&--center {
justify-content: center;
}
Expand Down Expand Up @@ -96,3 +89,11 @@
}
}
}

a.env-pagination__link[href=''],
.env-pagination__link:not([href]):not(:is(button)),
button.env-pagination__link[disabled],
.env-pagination__link.env-is-disabled {
// env-is-disabled is deprecated
@include is-disabled();
}

0 comments on commit 5401620

Please sign in to comment.