aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/style
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-10-11 20:25:47 +0800
committerFabio Berger <me@fabioberger.com>2018-10-11 20:25:47 +0800
commit295a8c760a6d5b567a12d6a2d83ae73021ea343c (patch)
treefaf6810a6b5b810869e36c20641fd4fe25e03ddb /packages/instant/src/style
parent9b147f14955c5f6a0b38e03ae30ac13b1be183d1 (diff)
parent1cfcc82ea9869e14c1a1b78e1376c89fdbeb91f4 (diff)
downloaddexon-0x-contracts-295a8c760a6d5b567a12d6a2d83ae73021ea343c.tar.gz
dexon-0x-contracts-295a8c760a6d5b567a12d6a2d83ae73021ea343c.tar.zst
dexon-0x-contracts-295a8c760a6d5b567a12d6a2d83ae73021ea343c.zip
merge dev-section-redesign
Diffstat (limited to 'packages/instant/src/style')
-rw-r--r--packages/instant/src/style/fonts.ts10
-rw-r--r--packages/instant/src/style/theme.ts27
-rw-r--r--packages/instant/src/style/util.ts11
3 files changed, 48 insertions, 0 deletions
diff --git a/packages/instant/src/style/fonts.ts b/packages/instant/src/style/fonts.ts
new file mode 100644
index 000000000..975a30a61
--- /dev/null
+++ b/packages/instant/src/style/fonts.ts
@@ -0,0 +1,10 @@
+import { injectGlobal } from './theme';
+
+export const fonts = {
+ include: () => {
+ // Inject the inter-ui font into the page
+ return injectGlobal`
+ @import url('https://rsms.me/inter/inter-ui.css');
+ `;
+ },
+};
diff --git a/packages/instant/src/style/theme.ts b/packages/instant/src/style/theme.ts
new file mode 100644
index 000000000..cf9da5378
--- /dev/null
+++ b/packages/instant/src/style/theme.ts
@@ -0,0 +1,27 @@
+import * as styledComponents from 'styled-components';
+
+const { default: styled, css, injectGlobal, keyframes, ThemeProvider } = styledComponents;
+
+export type Theme = { [key in ColorOption]: string };
+
+export enum ColorOption {
+ primaryColor = 'primaryColor',
+ black = 'black',
+ lightGrey = 'lightGrey',
+ grey = 'grey',
+ feintGrey = 'feintGrey',
+ darkGrey = 'darkGrey',
+ white = 'white',
+}
+
+export const theme: Theme = {
+ primaryColor: '#512D80',
+ black: 'black',
+ lightGrey: '#999999',
+ grey: '#666666',
+ feintGrey: '#DEDEDE',
+ darkGrey: '#333333',
+ white: 'white',
+};
+
+export { styled, css, injectGlobal, keyframes, ThemeProvider };
diff --git a/packages/instant/src/style/util.ts b/packages/instant/src/style/util.ts
new file mode 100644
index 000000000..c9df0f834
--- /dev/null
+++ b/packages/instant/src/style/util.ts
@@ -0,0 +1,11 @@
+import { ObjectMap } from '@0xproject/types';
+import * as _ from 'lodash';
+
+export const cssRuleIfExists = (props: ObjectMap<any>, rule: string): string => {
+ const camelCaseRule = _.camelCase(rule);
+ const ruleValueIfExists = props[camelCaseRule];
+ if (!_.isUndefined(ruleValueIfExists)) {
+ return `${rule}: ${ruleValueIfExists};`;
+ }
+ return '';
+};