-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement base HTML components for the
<hr>
element
The `Hr` component represents a `<hr>` (1) base HTML element to render a visual thematic break between paragraph-level elements. References: (1) https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr Associated epic: GH-69 GH-115
- Loading branch information
1 parent
63c2261
commit 50f81ab
Showing
3 changed files
with
40 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (C) 2018-present Arctic Ice Studio <[email protected]> | ||
* Copyright (C) 2018-present Sven Greb <[email protected]> | ||
* | ||
* Project: Nord Docs | ||
* Repository: https://github.com/arcticicestudio/nord-docs | ||
* License: MIT | ||
*/ | ||
|
||
import styled from "styled-components"; | ||
|
||
import { colors, motion, themedMode, MODE_BRIGHT_SNOW_FLURRY, MODE_DARK_NIGHT_FROST } from "styles/theme"; | ||
|
||
const backgroundColor = themedMode({ | ||
[MODE_BRIGHT_SNOW_FLURRY]: colors.nord4, | ||
[MODE_DARK_NIGHT_FROST]: colors.nord2 | ||
}); | ||
|
||
/** | ||
* A base HTML component that represents a visual thematic break between paragraph-level elements. | ||
* | ||
* @author Arctic Ice Studio <[email protected]> | ||
* @author Sven Greb <[email protected]> | ||
* @since 0.7.0 | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr | ||
*/ | ||
const Hr = styled.hr` | ||
background-color: ${backgroundColor}; | ||
border: 0; | ||
height: ${({ size }) => size || 1}px; | ||
margin: ${({ spacing }) => spacing || 5}em auto; | ||
width: ${({ spreadPercent }) => spreadPercent || 35}%; | ||
transition: background-color ${motion.speed.duration.transition.base.themeModeSwitch}ms ease-in-out; | ||
`; | ||
|
||
export default Hr; |
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