Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Extract figure and caption from Image so they can be reused for CFVideo
- Loading branch information
Showing
5 changed files
with
73 additions
and
46 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
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,10 @@ | ||
import styled from '@emotion/styled' | ||
import Atoms from './atoms' | ||
|
||
const Caption = styled('figcaption')` | ||
font-size: ${Atoms.font.size.small}; | ||
color: var(--meta-color, ${Atoms.colors.meta}); | ||
letter-spacing: 0.025em; | ||
` | ||
|
||
export default Caption |
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,32 @@ | ||
import styled from '@emotion/styled' | ||
import Atoms from './atoms' | ||
|
||
export interface FigureProps { | ||
className?: string | ||
responsive?: boolean | ||
margin?: boolean | ||
} | ||
|
||
const Figure = styled('figure')<FigureProps>( | ||
({ margin = true, responsive = true }) => ` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
writing-mode: horizontal-tb; | ||
margin-bottom: ${margin ? Atoms.spacing.medium : 0}; | ||
img { | ||
display: block; | ||
width: ${responsive ? '100%' : 'auto'}; | ||
flex: 1 1 auto; | ||
order: 2; | ||
} | ||
figcaption { | ||
order: 3; | ||
margin-top: ${Atoms.spacing.xxsmall}; | ||
} | ||
` | ||
) | ||
|
||
export default Figure |
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