Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add
overflow-x-scroll
for tables (#795)
* add `overflow-x-scroll` for tables * reuse nextra's scrollbar-y styles for scrollbar-x, adjust sidebar's scrollbar-y (#797)
- Loading branch information
1 parent
ff8967c
commit c3e6227
Showing
11 changed files
with
75 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'nextra': patch | ||
'nextra-theme-blog': patch | ||
'nextra-theme-docs': patch | ||
--- | ||
|
||
add `overflow-x-scroll` for tables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'nextra-theme-docs': patch | ||
--- | ||
|
||
reuse nextra's scrollbar-y styles for scrollbar-x, adjust sidebar's scrollbar-y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,32 @@ | ||
.nextra-scrollbar { | ||
scrollbar-gutter: stable; | ||
&::-webkit-scrollbar { | ||
width: 6px; | ||
@apply w-1.5 h-1.5; | ||
} | ||
&::-webkit-scrollbar-track { | ||
margin-top: 20px; | ||
margin-bottom: 16px; | ||
background-color: transparent; | ||
@apply bg-transparent my-5; | ||
} | ||
&::-webkit-scrollbar-thumb { | ||
box-shadow: inset 0 0 0 5px rgba(128, 128, 128, 0); | ||
border-radius: 20px; | ||
@apply rounded-[20px]; | ||
} | ||
&:hover::-webkit-scrollbar-thumb { | ||
box-shadow: inset 0 0 0 5px rgba(128, 128, 128, 0.2); | ||
&:hover { | ||
box-shadow: inset 0 0 0 5px rgba(128, 128, 128, 0.4); | ||
} | ||
@apply shadow-[inset_0_0_0_5px_var(--tw-shadow-color)]; | ||
@apply shadow-neutral-500/20 hover:shadow-neutral-500/40; | ||
} | ||
} | ||
|
||
.nextra-sidebar-container.with-menu.nextra-scrollbar::-webkit-scrollbar-track { | ||
margin-bottom: 76px; | ||
} | ||
|
||
@media (max-width: 767px) { | ||
.nextra-container .nextra-scrollbar { | ||
scrollbar-gutter: auto; | ||
@media (max-width: 767px) { | ||
.nextra-container & { | ||
scrollbar-gutter: auto; | ||
} | ||
} | ||
} | ||
|
||
/* Hide scrollbar */ | ||
.no-scrollbar { | ||
-ms-overflow-style: none; /* IE and Edge */ | ||
scrollbar-width: none; /* Firefox */ | ||
-ms-overflow-style: none; /* IE and Edge */ | ||
|
||
&::-webkit-scrollbar { | ||
display: none; /* Chrome, Safari and Opera */ | ||
@apply hidden; /* Chrome, Safari and Opera */ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React, { ComponentProps } from 'react' | ||
|
||
export const Table = ({ | ||
className = '', | ||
...props | ||
}: ComponentProps<'table'>) => ( | ||
<table className={'block overflow-x-scroll ' + className} {...props} /> | ||
) |