Skip to content

Commit

Permalink
fix(back-to-top): position (#1816)
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers authored Sep 3, 2024
1 parent 4ace92c commit f4fcd78
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .changeset/whole-pillows-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
"@rhds/elements": patch
---
`<rh-back-to-top>`: builds-in the style guidelines in: back to top is fixed and always on top. Note that this change removes previously undocumented CSS custom properties `--rh-back-to-top-position-right` and `--rh-back-to-top-position-bottom`.
11 changes: 6 additions & 5 deletions elements/rh-back-to-top/rh-back-to-top.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
:host {
position: absolute;
right: var(--rh-space-xl, 24px);
bottom: var(--rh-space-xl, 24px);
position: fixed;
z-index: 1000;
inset-inline-end: var(--rh-space-xl, 24px);
inset-block-end: var(--rh-space-xl, 24px);
}

[part="trigger"] {
Expand Down Expand Up @@ -54,7 +55,7 @@ span {

@media (min-width: 768px) {
:host {
right: var(--rh-back-to-top-position-right, var(--rh-space-3xl, 48px));
bottom: var(--rh-back-to-top-position-bottom, var(--rh-space-3xl, 48px));
inset-inline-end: var(--rh-space-3xl, 48px);
inset-block-end: var(--rh-space-3xl, 48px);
}
}
3 changes: 0 additions & 3 deletions elements/rh-back-to-top/rh-back-to-top.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@ import styles from './rh-back-to-top.css';
* to the top of a lengthy content page.
*
* @summary A shortcut to the top of the page content
*
* @csspart trigger - back to top link anchor element
* @slot - Text for the back to top link
*
*/
@customElement('rh-back-to-top')
export class RhBackToTop extends LitElement {
Expand Down

0 comments on commit f4fcd78

Please sign in to comment.