-
Notifications
You must be signed in to change notification settings - Fork 585
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #223 from storybookjs/hover-effect
Add hoverable effect to shared styles
- Loading branch information
Showing
2 changed files
with
56 additions
and
0 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,35 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { pageMargins, hoverEffect } from './shared/styles'; | ||
|
||
export default { | ||
title: 'Design System/SharedStyles', | ||
}; | ||
|
||
const BlockWithMargin = styled.div` | ||
${pageMargins}; | ||
height: 300px; | ||
background-color: #333; | ||
`; | ||
|
||
export const PageMargins = () => ( | ||
<div> | ||
<p> | ||
The box below has <code>pageMargins</code> styles applied to it which controls the horizontal | ||
padding and margin | ||
</p> | ||
<BlockWithMargin /> | ||
</div> | ||
); | ||
|
||
const BlockWithHoverEffect = styled.div` | ||
${hoverEffect}; | ||
display: block; | ||
height: 300px; | ||
`; | ||
|
||
export const HoverEffectRest = () => <BlockWithHoverEffect />; | ||
|
||
export const HoverEffectHover = () => <BlockWithHoverEffect className="__hover" />; | ||
|
||
export const HoverEffectActive = () => <BlockWithHoverEffect className="__active" />; |
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