Skip to content

Commit

Permalink
Merge pull request #347 from ingokpp/enhancement/#2979-scrollable-tab…
Browse files Browse the repository at this point in the history
…s-fade

Enhancement/#2979 scrollable tabs fade out effect
  • Loading branch information
MildTomato authored Jun 1, 2022
2 parents 8777667 + 6ffeab9 commit 7c69701
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
10 changes: 8 additions & 2 deletions development.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,20 @@ make sure you are in the supabase-ui folder
cd supabase-ui
```

install dependencies

> :warning: **This project currently won't work using the latest node version. Internally we are using node 17.**
```cli
npm install
```

run storybook

```cli
npm run storybook
```

(you may need to run `npm install` first)

Storybook runs by default on `http://localhost:6006/`

## Local Development
Expand Down
4 changes: 2 additions & 2 deletions src/lib/theme/defaultTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ export default {
size: {
...default__padding_and_text,
},
scrollable: `overflow-auto whitespace-nowrap`,
content: `focus:outline-none focus:ring`,
scrollable: `overflow-auto whitespace-nowrap no-scrollbar mask-fadeout-right`,
content: `focus:outline-none focus:ring text-scale-900`,
},

/*
Expand Down
21 changes: 21 additions & 0 deletions ui.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,27 @@ const uiConfig = {
border: '1px solid hsla(0, 0%, 39.2%, 0.2)',
borderRadius: '3px',
},
'.no-scrollbar': {
/* Hide scrollbar for IE, Edge*/
'-ms-overflow-style': 'none',

/* Firefox */
'scrollbar-width': 'none', /* Firefox */

/* Hide scrollbar for Chrome, Safari and Opera */
'&::-webkit-scrollbar': {
display: 'none'
}
},
/* Add fadeout effect */
'.mask-fadeout-right': {
'-webkit-mask-image': 'linear-gradient(to right, white 98%, transparent 100%)',
'mask-image': 'linear-gradient(to right, white 98%, transparent 100%)',
},
'.mask-fadeout-left': {
'-webkit-mask-image': 'linear-gradient(to left, white 98%, transparent 100%)',
'mask-image': 'linear-gradient(to left, white 98%, transparent 100%)',
},
})
addVariant('data-open-parent', '[data-state="open"] &')
addVariant('data-closed-parent', '[data-state="closed"] &')
Expand Down

0 comments on commit 7c69701

Please sign in to comment.