-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: set content elements margin to 0 and add a content class for fo…
…rmating content nicely
- Loading branch information
Showing
5 changed files
with
77 additions
and
2 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,38 @@ | ||
import { concatClassNames } from "@sys42/utils"; | ||
import { useValue } from "react-cosmos/client"; | ||
|
||
import { classContent } from "../lib/main"; | ||
|
||
export default function Fixture() { | ||
const [isEnabled] = useValue("isEnabled", { defaultValue: true }); | ||
return ( | ||
<div style={{ padding: "2rem" }}> | ||
<div>I am before</div> | ||
<div className={concatClassNames(isEnabled && classContent)}> | ||
<h2>I am a heading2</h2> | ||
<p> | ||
And this is a little paragraph that contains text. Nothing special | ||
here just a few words to fill this paragraph. Yeah, really, no | ||
valueable information here, stop wasting you time. | ||
</p> | ||
<h3>I am a heading3 with a paragraph and a list below</h3> | ||
<p> | ||
This is another paragraph with some text. Nothing extraordinary here, | ||
just a few words to fill this space. Seriously, no valuable | ||
information here, stop wasting your time. | ||
</p> | ||
<ul> | ||
<li>First item</li> | ||
<li>Second item</li> | ||
<li>Third item</li> | ||
</ul> | ||
<p> | ||
This is a different paragraph with some other text. Still, nothing | ||
special here, just a few words to fill this paragraph. Really, no | ||
valuable information here, you might want to move on. | ||
</p> | ||
</div> | ||
<div>I am after</div> | ||
</div> | ||
); | ||
} |
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,3 @@ | ||
import styles from "./styles.module.css"; | ||
const classContent = styles.classContent; | ||
export { classContent }; |
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,25 @@ | ||
.classContent h1, | ||
.classContent h2, | ||
.classContent h3, | ||
.classContent h4, | ||
.classContent h5, | ||
.classContent h6, | ||
.classContent p, | ||
.classContent ul, | ||
.classContent ol, | ||
.classContent dl, | ||
.classContent blockquote, | ||
.classContent pre, | ||
.classContent table, | ||
.classContent figure, | ||
.classContent hr { | ||
margin: revert; | ||
} | ||
|
||
.classContent > *:last-child { | ||
margin-bottom: 0; | ||
} | ||
|
||
.classContent > *:first-child { | ||
margin-top: 0; | ||
} |
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