Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit e3b5e9c

Browse files
Jeesun KimJeesun Kim
Jeesun Kim
authored and
Jeesun Kim
committed
update/styleguidist_layout > updating styleguidist style because its hierarchy made no sense
1 parent 82b7af6 commit e3b5e9c

File tree

2 files changed

+161
-7
lines changed

2 files changed

+161
-7
lines changed

styleguide.config.js

+34-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,37 @@
1+
const { styles, theme } = require("./styleguide.styles");
2+
13
module.exports = {
24
sections: [
35
{
46
name: "Web",
5-
components: "src/components/*.js",
67
content: "src/README.md",
8+
sections: [
9+
{
10+
name: "Typography & Colors",
11+
components: () => [
12+
"src/components/GlobalStyle.js",
13+
"src/components/PageHeader.js",
14+
"src/components/SectionHeader.js",
15+
"src/components/SubsectionHeader.js",
16+
],
17+
},
18+
{
19+
name: "Components",
20+
components: () => [
21+
"src/components/BulletedList.js",
22+
"src/components/Button.js",
23+
],
24+
},
25+
{
26+
name: "Form",
27+
components: () => [
28+
"src/components/Checkbox.js",
29+
"src/components/Input.js",
30+
"src/components/Select.js",
31+
"src/components/Textarea.js",
32+
],
33+
},
34+
],
735
},
836
{
937
name: "React Native",
@@ -16,17 +44,16 @@ module.exports = {
1644
links: [
1745
{
1846
rel: "stylesheet",
19-
href:
47+
href: [
2048
"https://fonts.googleapis.com/css?family=IBM+Plex+Sans&display=swap",
49+
"https://fonts.googleapis.com/css?family=IBM+Plex+Mono&display=swap",
50+
],
2151
},
2252
],
2353
},
2454
},
25-
theme: {
26-
fontFamily: {
27-
base: '"IBM Plex Sans", "Helvetica Neue", Arial, sans-serif',
28-
},
29-
},
55+
styles,
56+
theme,
3057
pagePerSection: true,
3158
webpackConfig: {
3259
resolve: {

styleguide.styles.js

+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
const colors = {
2+
danger: "#d9534f",
3+
white: "#ffffff",
4+
black: "#000000",
5+
black60: "#666666",
6+
primary: "#3e1bdb",
7+
grey: "#7a898f",
8+
sidebarGrey: "#fafafa",
9+
lightGrey: "#aec0c6",
10+
paleGrey: "#ebf1f3",
11+
secondary: "#ad29b6",
12+
};
13+
14+
const theme = {
15+
color: {
16+
baseBackground: colors.white,
17+
border: colors.paleGrey,
18+
codeBackground: colors.paleGrey,
19+
error: colors.danger,
20+
light: colors.grey,
21+
lightest: colors.lightGrey,
22+
name: colors.primary,
23+
type: colors.secondary,
24+
base: colors.black60,
25+
linkHover: colors.primary,
26+
sidebarBackground: colors.sidebarGrey,
27+
},
28+
fontFamily: {
29+
base: '"IBM Plex Sans", "Helvetica Neue", Arial, sans-serif',
30+
monospace: '"IBM Plex Mono",Consolas, Menlo, monospace',
31+
},
32+
fontSize: {
33+
base: 16,
34+
text: 16,
35+
h1: 32,
36+
h2: 24,
37+
h3: 18,
38+
},
39+
maxWidth: 780,
40+
sidebarWidth: 280,
41+
};
42+
43+
const styles = {
44+
Heading: {
45+
heading1: {
46+
display: "block",
47+
position: "relative",
48+
marginBottom: "1.125rem",
49+
color: `${colors.black}`,
50+
},
51+
heading2: {
52+
marginBottom: "0.75rem",
53+
color: colors.black,
54+
},
55+
heading3: {
56+
borderBottom: `thin solid ${colors.lightGrey}`,
57+
paddingBottom: "0.375rem",
58+
marginBottom: "1.5rem",
59+
textTransform: "uppercase",
60+
fontWeight: "700",
61+
},
62+
},
63+
ReactComponent: {
64+
tabs: {
65+
backgroundColor: colors.paleGrey,
66+
padding: "0 1.5rem",
67+
overflow: "auto",
68+
},
69+
tabButtons: {
70+
marginBottom: 0,
71+
},
72+
},
73+
SectionHeading: {
74+
sectionName: {
75+
display: "block",
76+
paddingTop: `1.5rem !important`,
77+
textDecoration: "none !important",
78+
"&:hover": {
79+
opacity: 0.75,
80+
},
81+
},
82+
},
83+
StyleGuide: {
84+
content: {
85+
paddingTop: "3.75rem",
86+
},
87+
sidebar: {
88+
border: 0,
89+
"& li > a": {
90+
color: `${colors.black} !important`,
91+
cursor: "pointer",
92+
},
93+
},
94+
},
95+
TabButton: {
96+
button: {
97+
width: "100%",
98+
},
99+
isActive: {
100+
border: 0,
101+
},
102+
},
103+
Table: {
104+
table: {
105+
marginTop: "0.75rem",
106+
marginBottom: "0.75rem",
107+
minWidth: "600px",
108+
},
109+
cellHeading: {
110+
borderBottom: `thin solid ${colors.lightGrey}`,
111+
},
112+
cell: {
113+
paddingBottom: 0,
114+
"& p": {
115+
marginBottom: "0.1875rem !important",
116+
},
117+
'& div[class*="para"]': {
118+
marginBottom: "0.1875rem !important",
119+
},
120+
},
121+
},
122+
};
123+
124+
module.exports = {
125+
styles: styles,
126+
theme: theme,
127+
};

0 commit comments

Comments
 (0)