Skip to content

Commit

Permalink
fix: add item shadow to CSS API
Browse files Browse the repository at this point in the history
  • Loading branch information
StepanKirichenko committed Aug 2, 2024
1 parent 24f293e commit 8698e66
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
4 changes: 3 additions & 1 deletion src/components/Drawer/Drawer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ $block: '.#{variables.$ns}drawer';
#{$block} {
pointer-events: none;

--_--item-shadow-default: 0 1px 5px 0 var(--g-color-sfx-shadow);

--_--resizer-width: 8px;
--_--resizer-color: var(--g-color-base-generic);
--_--resizer-handle-color: var(--g-color-line-generic);
Expand All @@ -14,7 +16,7 @@ $block: '.#{variables.$ns}drawer';
--_--veil-background-color: var(--g-color-sfx-veil);

&_hideVeil {
--_--item-shadow: 0 1px 5px 0 var(--g-color-sfx-shadow);
--_--item-shadow: var(--gn-drawer-item-shadow, var(--_--item-shadow-default));
}

&__item {
Expand Down
22 changes: 12 additions & 10 deletions src/components/Drawer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,15 @@ The Drawer module consists of two primary components: `Drawer` and `DrawerItem`.

## CSS API

| Name | Description | Default |
| :-------------------------------------------- | :---------------------------------------------------------- | :----------------------------: |
| Veil | | |
| `--gn-drawer-veil-background-color` | The color of the veil element | `--g-color-sfx-veil` |
| Resizer | | |
| `--gn-drawer-item-resizer-width` | The width of the resizer element | 8px |
| `--gn-drawer-item-resizer-color` | The color of the resizer element | `--g-color-base-generic` |
| `--gn-drawer-item-resizer-handle-color` | The color of the resizer handle | `--g-color-line-generic` |
| `--gn-drawer-item-resizer-handle-color-hover` | The color of the resizer handle when the resizer is hovered | `--g-color-line-generic-hover` |
| `--gn-drawer-item-resizer-z-index` | z-index of the resizer element | 100 |
| Name | Description | Default |
| :-------------------------------------------- | :---------------------------------------------------------- | :-------------------------------------: |
| DrawerItem | | |
| `--gn-drawer-item-shadow` | The box-shadow of the drawer item when veil is hidden | `0 1px 5px 0 var(--g-color-sfx-shadow)` |
| Veil | | |
| `--gn-drawer-veil-background-color` | The color of the veil element | `--g-color-sfx-veil` |
| Resizer | | |
| `--gn-drawer-item-resizer-width` | The width of the resizer element | 8px |
| `--gn-drawer-item-resizer-color` | The color of the resizer element | `--g-color-base-generic` |
| `--gn-drawer-item-resizer-handle-color` | The color of the resizer handle | `--g-color-line-generic` |
| `--gn-drawer-item-resizer-handle-color-hover` | The color of the resizer handle when the resizer is hovered | `--g-color-line-generic-hover` |
| `--gn-drawer-item-resizer-z-index` | z-index of the resizer element | 100 |

0 comments on commit 8698e66

Please sign in to comment.