Skip to content

Commit

Permalink
feat: add --side-drawer-offset custom property to be able to offset t…
Browse files Browse the repository at this point in the history
…he drawer
  • Loading branch information
ozanmuyes committed Aug 26, 2024
1 parent 0529d7c commit e803f61
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ You can customize styling with the following CSS variables:
| `--side-drawer-backdrop-filter` | `none` | The backdrop-filter for both the drawer and the overlay that appears to the right of the drawer (when it's open) |
| `--side-drawer-overlay-transition` | `opacity linear 0.25s` | The transition for the overlay that appears to the right of the drawer (when it's open) |
| `--side-drawer-overlay-opacity` | `0.7` | The opacity of the overlay |
| `--side-drawer-offset` | `0` | Offset for the underlying `<dialog>` from left (by default) or right (if `<side-drawer right>`) |

## Contribute

Expand Down
4 changes: 2 additions & 2 deletions side-drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dialog {
position: fixed;
top: 0;
bottom: 0;
left: 0;
left: var(--side-drawer-offset, 0);
height: 100%;
transform: translateX(-100%);
Expand All @@ -34,7 +34,7 @@ dialog {
:host([right]) dialog {
left: unset;
right: 0;
right: var(--side-drawer-offset, 0);
transform: translateX(100%);
}
Expand Down

0 comments on commit e803f61

Please sign in to comment.