Skip to content

Commit fe94fe6

Browse files
committed
setup basic styled-components with rebass
1 parent 52bd897 commit fe94fe6

File tree

4 files changed

+132
-6
lines changed

4 files changed

+132
-6
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"react": "^16.6.3",
77
"react-dom": "^16.6.3",
88
"react-router-dom": "^5.0.0",
9-
"react-scripts": "3.0.0"
9+
"react-scripts": "3.0.0",
10+
"rebass": "^3.1.0",
11+
"styled-components": "^4.2.0"
1012
},
1113
"scripts": {
1214
"start": "react-scripts start",

src/components/Dashboard.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
import React from 'react';
2+
import { Flex, Heading, Card, Text } from 'components/library';
23

34
export default function Dashboard() {
45
return (
5-
<div data-e2e="dashboard">
6-
<h1>Dashboard</h1>
7-
</div>
6+
<Flex alignItems="center" data-e2e="dashboard">
7+
<Card width={1 / 2}>
8+
<Heading>Hello</Heading>
9+
</Card>
10+
<Card width={1 / 2}>
11+
<Text>Grid</Text>
12+
</Card>
13+
</Flex>
814
);
915
}

src/components/library.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from 'react';
2+
import {
3+
Box as RebassBox,
4+
Flex as RebassFlex,
5+
Card as RebassCard,
6+
Heading as RebassHeading,
7+
Text as RebassText,
8+
Link as RebassLink,
9+
Button as ReabssButton
10+
} from 'rebass';
11+
12+
const Box = props => <RebassBox {...props} />;
13+
const Card = props => <RebassCard {...props} mx="auto" />;
14+
const Flex = props => <RebassFlex {...props} />;
15+
const Heading = props => <RebassHeading {...props} />;
16+
const Text = props => <RebassText {...props} />;
17+
const Link = props => <RebassLink {...props} />;
18+
const Button = props => <ReabssButton {...props} />;
19+
20+
export { Box, Card, Flex, Heading, Text, Button, Link };

yarn.lock

Lines changed: 100 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,23 @@
928928
debug "^3.1.0"
929929
lodash.once "^4.1.1"
930930

931+
"@emotion/is-prop-valid@^0.7.3":
932+
version "0.7.3"
933+
resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-0.7.3.tgz#a6bf4fa5387cbba59d44e698a4680f481a8da6cc"
934+
integrity sha512-uxJqm/sqwXw3YPA5GXX365OBcJGFtxUVkB6WyezqFHlNe9jqUWH5ur2O2M8dGBz61kn1g3ZBlzUunFQXQIClhA==
935+
dependencies:
936+
"@emotion/memoize" "0.7.1"
937+
938+
"@emotion/[email protected]":
939+
version "0.7.1"
940+
resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.7.1.tgz#e93c13942592cf5ef01aa8297444dc192beee52f"
941+
integrity sha512-Qv4LTqO11jepd5Qmlp3M1YEjBumoTHcHFdgPTQ+sFlIL5myi/7xu/POwP7IRu6odBdmLXdtIs1D6TuW6kbwbbg==
942+
943+
"@emotion/unitless@^0.7.0":
944+
version "0.7.3"
945+
resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.7.3.tgz#6310a047f12d21a1036fb031317219892440416f"
946+
integrity sha512-4zAPlpDEh2VwXswwr/t8xGNDGg8RQiPxtxZ3qQEXyQsBV39ptTdESCjuBvGze1nLMVrxmTIKmnO/nAV8Tqjjzg==
947+
931948
932949
version "2.0.0"
933950
resolved "https://registry.yarnpkg.com/@hapi/address/-/address-2.0.0.tgz#9f05469c88cb2fd3dcd624776b54ee95c312126a"
@@ -1955,6 +1972,21 @@ babel-plugin-named-asset-import@^0.3.2:
19551972
resolved "https://registry.yarnpkg.com/babel-plugin-named-asset-import/-/babel-plugin-named-asset-import-0.3.2.tgz#20978ed446b8e1bf4a2f42d0a94c0ece85f75f4f"
19561973
integrity sha512-CxwvxrZ9OirpXQ201Ec57OmGhmI8/ui/GwTDy0hSp6CmRvgRC0pSair6Z04Ck+JStA0sMPZzSJ3uE4n17EXpPQ==
19571974

1975+
"babel-plugin-styled-components@>= 1":
1976+
version "1.10.0"
1977+
resolved "https://registry.yarnpkg.com/babel-plugin-styled-components/-/babel-plugin-styled-components-1.10.0.tgz#ff1f42ad2cc78c21f26b62266b8f564dbc862939"
1978+
integrity sha512-sQVKG8irFXx14ZfaK1bBePirfkacl3j8nZwSZK+ZjsbnadRHKQTbhXbe/RB1vT6Vgkz45E+V95LBq4KqdhZUNw==
1979+
dependencies:
1980+
"@babel/helper-annotate-as-pure" "^7.0.0"
1981+
"@babel/helper-module-imports" "^7.0.0"
1982+
babel-plugin-syntax-jsx "^6.18.0"
1983+
lodash "^4.17.10"
1984+
1985+
babel-plugin-syntax-jsx@^6.18.0:
1986+
version "6.18.0"
1987+
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946"
1988+
integrity sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=
1989+
19581990
babel-plugin-syntax-object-rest-spread@^6.8.0:
19591991
version "6.13.0"
19601992
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5"
@@ -2369,6 +2401,11 @@ camelcase@^5.0.0, camelcase@^5.2.0, camelcase@^5.3.1:
23692401
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"
23702402
integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
23712403

2404+
camelize@^1.0.0:
2405+
version "1.0.0"
2406+
resolved "https://registry.yarnpkg.com/camelize/-/camelize-1.0.0.tgz#164a5483e630fa4321e5af07020e531831b2609b"
2407+
integrity sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs=
2408+
23722409
caniuse-api@^3.0.0:
23732410
version "3.0.0"
23742411
resolved "https://registry.yarnpkg.com/caniuse-api/-/caniuse-api-3.0.0.tgz#5e4d90e2274961d46291997df599e3ed008ee4c0"
@@ -2911,6 +2948,11 @@ css-blank-pseudo@^0.1.4:
29112948
dependencies:
29122949
postcss "^7.0.5"
29132950

2951+
css-color-keywords@^1.0.0:
2952+
version "1.0.0"
2953+
resolved "https://registry.yarnpkg.com/css-color-keywords/-/css-color-keywords-1.0.0.tgz#fea2616dc676b2962686b3af8dbdbe180b244e05"
2954+
integrity sha1-/qJhbcZ2spYmhrOvjb2+GAskTgU=
2955+
29142956
[email protected], css-color-names@^0.0.4:
29152957
version "0.0.4"
29162958
resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-0.0.4.tgz#808adc2e79cf84738069b646cb20ec27beb629e0"
@@ -2981,6 +3023,15 @@ css-select@^2.0.0:
29813023
domutils "^1.7.0"
29823024
nth-check "^1.0.2"
29833025

3026+
css-to-react-native@^2.2.2:
3027+
version "2.3.0"
3028+
resolved "https://registry.yarnpkg.com/css-to-react-native/-/css-to-react-native-2.3.0.tgz#bf80d24ec4a08e430306ef429c0586e6ed5485f7"
3029+
integrity sha512-IhR7bNIrCFwbJbKZOAjNDZdwpsbjTN6f1agXeELHDqg1wHPA8c2QLruttKOW7hgMGetkfraRJCIEMrptifBfVw==
3030+
dependencies:
3031+
camelize "^1.0.0"
3032+
css-color-keywords "^1.0.0"
3033+
postcss-value-parser "^3.3.0"
3034+
29843035
29853036
version "1.0.0-alpha.28"
29863037
resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.0.0-alpha.28.tgz#8e8968190d886c9477bc8d61e96f61af3f7ffa7f"
@@ -6431,6 +6482,11 @@ mem@^4.0.0:
64316482
mimic-fn "^2.0.0"
64326483
p-is-promise "^2.0.0"
64336484

6485+
memoize-one@^5.0.0:
6486+
version "5.0.4"
6487+
resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.0.4.tgz#005928aced5c43d890a4dfab18ca908b0ec92cbc"
6488+
integrity sha512-P0z5IeAH6qHHGkJIXWw0xC2HNEgkx/9uWWBQw64FJj3/ol14VYdfVGWWr0fXfjhhv3TKVIqUq65os6O4GUNksA==
6489+
64346490
memory-fs@^0.4.0, memory-fs@^0.4.1, memory-fs@~0.4.1:
64356491
version "0.4.1"
64366492
resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552"
@@ -8161,7 +8217,7 @@ prompts@^2.0.1:
81618217
kleur "^3.0.2"
81628218
sisteransi "^1.0.0"
81638219

8164-
prop-types@^15.6.2:
8220+
prop-types@^15.5.4, prop-types@^15.6.2, prop-types@^15.7.2:
81658221
version "15.7.2"
81668222
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
81678223
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
@@ -8564,6 +8620,13 @@ realpath-native@^1.1.0:
85648620
dependencies:
85658621
util.promisify "^1.0.0"
85668622

8623+
rebass@^3.1.0:
8624+
version "3.1.0"
8625+
resolved "https://registry.yarnpkg.com/rebass/-/rebass-3.1.0.tgz#6f3779a20fd5e196623f45463b2aa8843e5feb5e"
8626+
integrity sha512-FtmBb0bDT8q8HaGT4uAiJAQKZOdMsdonx6vp/cjnPc23FdMoo74ClTm0vJAwkWY1KzA0LCvmPbyGvWE0FFMR8w==
8627+
dependencies:
8628+
styled-system "^4.0.8"
8629+
85678630
85688631
version "2.2.2"
85698632
resolved "https://registry.yarnpkg.com/recursive-readdir/-/recursive-readdir-2.2.2.tgz#9946fb3274e1628de6e36b2f6714953b4845094f"
@@ -9545,6 +9608,31 @@ [email protected]:
95459608
loader-utils "^1.1.0"
95469609
schema-utils "^1.0.0"
95479610

9611+
styled-components@^4.2.0:
9612+
version "4.2.0"
9613+
resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-4.2.0.tgz#811fbbec4d64c7189f6c7482b9eb6fefa7fefef7"
9614+
integrity sha512-L/LzkL3ZbBhqIVHdR7DbYujy4tqvTNRfc+4JWDCYyhTatI+8CRRQUmdaR0+ARl03DWsfKLhjewll5uNLrqrl4A==
9615+
dependencies:
9616+
"@babel/helper-module-imports" "^7.0.0"
9617+
"@emotion/is-prop-valid" "^0.7.3"
9618+
"@emotion/unitless" "^0.7.0"
9619+
babel-plugin-styled-components ">= 1"
9620+
css-to-react-native "^2.2.2"
9621+
memoize-one "^5.0.0"
9622+
prop-types "^15.5.4"
9623+
react-is "^16.6.0"
9624+
stylis "^3.5.0"
9625+
stylis-rule-sheet "^0.0.10"
9626+
supports-color "^5.5.0"
9627+
9628+
styled-system@^4.0.8:
9629+
version "4.2.1"
9630+
resolved "https://registry.yarnpkg.com/styled-system/-/styled-system-4.2.1.tgz#ae2ac256948e7b483b4f9f9ad0034ebe94e6d2f1"
9631+
integrity sha512-JlpZmj4QSvrurga+ea00x0u8dl7nFLJS7pLsdtTVo+/AoCepqkG4FOBTaw1ATgsSbJeLaiicVg/Mj955GJUbuA==
9632+
dependencies:
9633+
"@babel/runtime" "^7.4.2"
9634+
prop-types "^15.7.2"
9635+
95489636
stylehacks@^4.0.0:
95499637
version "4.0.3"
95509638
resolved "https://registry.yarnpkg.com/stylehacks/-/stylehacks-4.0.3.tgz#6718fcaf4d1e07d8a1318690881e8d96726a71d5"
@@ -9554,7 +9642,17 @@ stylehacks@^4.0.0:
95549642
postcss "^7.0.0"
95559643
postcss-selector-parser "^3.0.0"
95569644

9557-
[email protected], supports-color@^5.3.0:
9645+
stylis-rule-sheet@^0.0.10:
9646+
version "0.0.10"
9647+
resolved "https://registry.yarnpkg.com/stylis-rule-sheet/-/stylis-rule-sheet-0.0.10.tgz#44e64a2b076643f4b52e5ff71efc04d8c3c4a430"
9648+
integrity sha512-nTbZoaqoBnmK+ptANthb10ZRZOGC+EmTLLUxeYIuHNkEKcmKgXX1XWKkUBT2Ac4es3NybooPe0SmvKdhKJZAuw==
9649+
9650+
stylis@^3.5.0:
9651+
version "3.5.4"
9652+
resolved "https://registry.yarnpkg.com/stylis/-/stylis-3.5.4.tgz#f665f25f5e299cf3d64654ab949a57c768b73fbe"
9653+
integrity sha512-8/3pSmthWM7lsPBKv7NXkzn2Uc9W7NotcwGNpJaa3k7WMM1XDCA4MgT5k/8BIexd5ydZdboXtU90XH9Ec4Bv/Q==
9654+
9655+
[email protected], supports-color@^5.3.0, supports-color@^5.5.0:
95589656
version "5.5.0"
95599657
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
95609658
integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==

0 commit comments

Comments
 (0)