Skip to content

Commit

Permalink
feat(scrollbar): add native scrollbar styles
Browse files Browse the repository at this point in the history
  • Loading branch information
apust committed Feb 12, 2021
1 parent 26523e9 commit c1502b4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/packages/core/src/scrollbar/scrollbar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
._e_scrollbar::-webkit-scrollbar {
width: var(--S8);
}

._e_scrollbar::-webkit-scrollbar-track {
background-color: transparent;
}

._e_scrollbar::-webkit-scrollbar-thumb {
border-radius: var(--S4);
background-color: var(--N200);
}
7 changes: 7 additions & 0 deletions src/packages/core/src/scrollbar/scrollbar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="_e_scrollbar" style="height: 200px; overflow-y: scroll; font: var(--Body1);">
<p>A male hummingbird simply pausing on a perch can mesmerize us with his colorful, iridescent plumage. But it turns out we humans are likely missing the full effect—because hummingbirds see colors that humans cannot detect, a new study says.</p>
<p>Scientists have long known that birds probably have better color vision than humans do. Like most primates, humans are trichromatic—that is, our eyes have three types of color-sensitive receptors or cones: blue, green, and red. But birds have four color cones, meaning they are tetrachromatic.</p>
<p>With our three color cones, we can see the colors of the rainbow—red, orange, yellow, green, blue, indigo, and violet—the so-called spectral hues. We can also see one pure nonspectral (meaning, not in the rainbow) color, purple, because it stimulates our red and blue cones simultaneously.</p>
<p>Birds’ four color cones theoretically let them discriminate a broader range of colors, including the ultraviolet spectrum, which includes colors such as UV-green and UV-red. But so far, researchers have made few investigations into what birds can actually see. (Explore our interactive on the science of hummingbirds.)</p>
<p>Then Mary Stoddard, a Princeton University evolutionary biologist, and colleagues carried out a series of field experiments with wild broad-tailed hummingbirds near the Rocky Mountain Biological Laboratory in Colorado. The remarkable results revealed the birds could discern spectral-colored feeders from feeders in nonspectral colors.</p>
</div>
14 changes: 14 additions & 0 deletions src/packages/core/src/scrollbar/scrollbar.stories.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Meta, Preview, Story } from '@storybook/addon-docs/blocks';
import pretty from 'pretty';

import scrollbar from './scrollbar.html';

<Meta title='Core/Scrollbar' />

# Modal

<Preview>
<Story name="default" height="240px" parameters={{ docs: { source: { code: pretty(scrollbar) } } }}>
{ () => scrollbar }
</Story>
</Preview>

0 comments on commit c1502b4

Please sign in to comment.