-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Storybook] Update styles to be more accurate to prod #1945
Merged
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d5abc66
[Storybook] Update styles to be more accurate to prod
nishasy d498113
prettier
nishasy 281b86c
Update comments, remove extra styles
nishasy 1d9edc2
prettier
nishasy 0029d19
move styles out of storybook folder. remove unnecessary
nishasy dd756f0
remove StoryWrapper. add legacy to layers
nishasy 30970dd
Merge branch 'main' into storybook-styles
nishasy 8766cc7
changeset
nishasy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,20 @@ | ||
import * as React from "react"; | ||
|
||
/** | ||
* Wrapper for Storybook stories that | ||
* 1. Renders the story inside of a .framework-perseus container | ||
* 2. Includes the global styles from prod | ||
*/ | ||
function StoryWrapper(props) { | ||
// Most of our components have an expectation to be | ||
// rendered inside of a .framework-perseus container. | ||
// We want to make sure we can include it here, since it | ||
// can also affect the styling. | ||
return ( | ||
<div className="framework-perseus box-sizing-border-box-reset"> | ||
{props.children} | ||
</div> | ||
); | ||
} | ||
|
||
export default StoryWrapper; |
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,42 @@ | ||
/** | ||
* This file contains styles that are used in prod that ultimately | ||
* get passed onto Perseus components. This file is imported in the | ||
* .storybook/preview.js file so that the components can have the same | ||
* styles as prod when viewed within Storybook. | ||
*/ | ||
|
||
// Variables | ||
@offBlack: #21242c; | ||
@wonderBlocksFontFamily: "Lato", "Noto Sans", "Helvetica", "Corbel", sans-serif; | ||
|
||
// Layers | ||
@layer reset, shared; | ||
|
||
@layer reset { | ||
// A CSS reset. Needed for every page. | ||
@import (inline) "./reset.css"; | ||
} | ||
|
||
@layer shared { | ||
html, | ||
body { | ||
height: 100%; | ||
} | ||
|
||
body { | ||
font-family: @wonderBlocksFontFamily, "Helvetica", "Corbel", sans-serif; | ||
font-size: 14px; | ||
margin: 0; | ||
color: @offBlack; | ||
line-height: 1.4; | ||
min-width: 0; | ||
} | ||
|
||
.box-sizing-border-box-reset { | ||
box-sizing: border-box; | ||
} | ||
|
||
.box-sizing-border-box-reset * { | ||
box-sizing: inherit; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
@import "./variables.less"; | ||
@import "./util.less"; | ||
@import "./global.less"; | ||
|
||
@import "./styles.less"; | ||
|
||
|
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,131 @@ | ||
/* http://meyerweb.com/eric/tools/css/reset/ | ||
v2.0 | 20110126 | ||
License: none (public domain) | ||
*/ | ||
|
||
html, | ||
body, | ||
div, | ||
span, | ||
applet, | ||
object, | ||
iframe, | ||
h1, | ||
h2, | ||
h3, | ||
h4, | ||
h5, | ||
h6, | ||
p, | ||
blockquote, | ||
pre, | ||
a, | ||
abbr, | ||
acronym, | ||
address, | ||
big, | ||
cite, | ||
code, | ||
del, | ||
dfn, | ||
em, | ||
img, | ||
ins, | ||
kbd, | ||
q, | ||
s, | ||
samp, | ||
small, | ||
strike, | ||
strong, | ||
sub, | ||
sup, | ||
tt, | ||
var, | ||
b, | ||
u, | ||
i, | ||
center, | ||
dl, | ||
dt, | ||
dd, | ||
ol, | ||
ul, | ||
li, | ||
fieldset, | ||
form, | ||
label, | ||
legend, | ||
table, | ||
caption, | ||
tbody, | ||
tfoot, | ||
thead, | ||
tr, | ||
th, | ||
td, | ||
article, | ||
aside, | ||
canvas, | ||
details, | ||
embed, | ||
figure, | ||
figcaption, | ||
footer, | ||
header, | ||
hgroup, | ||
menu, | ||
nav, | ||
output, | ||
ruby, | ||
section, | ||
summary, | ||
time, | ||
mark, | ||
audio, | ||
video { | ||
margin: 0; | ||
padding: 0; | ||
border: 0; | ||
font-size: 100%; | ||
font: inherit; | ||
vertical-align: baseline; | ||
} | ||
/* HTML5 display-role reset for older browsers */ | ||
article, | ||
aside, | ||
details, | ||
figcaption, | ||
figure, | ||
footer, | ||
header, | ||
hgroup, | ||
menu, | ||
nav, | ||
section { | ||
display: block; | ||
} | ||
body { | ||
line-height: 1; | ||
} | ||
ol, | ||
ul { | ||
list-style: none; | ||
} | ||
blockquote, | ||
q { | ||
quotes: none; | ||
} | ||
blockquote:before, | ||
blockquote:after, | ||
q:before, | ||
q:after { | ||
content: ""; | ||
content: none; | ||
} | ||
table { | ||
border-collapse: collapse; | ||
border-spacing: 0; | ||
} | ||
|
||
/* End Reset */ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a separate file for this? Could we not just wrap the
preview.tsx
content in this<div>
directly?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah. Now that I removed the import, I'll change it back to how it was before.