vega-frontend-monorepo/libs/tailwindcss-config/src/theme.js

189 lines
4.1 KiB
JavaScript
Raw Normal View History

2022-02-23 17:57:44 +00:00
const defaultTheme = require('tailwindcss/defaultTheme');
const shadeOfGray = (shade) => {
const decValue = Math.round((255 * shade) / 100);
const hexValue = decValue.toString(16).padStart(2, '0');
return `#${hexValue}${hexValue}${hexValue}`;
};
2022-02-23 17:57:44 +00:00
module.exports = {
screens: {
xs: '500px',
sm: '640px',
md: '768px',
2022-02-23 17:57:44 +00:00
lg: '960px',
xl: '1280px',
xxl: '1536px',
2022-02-23 17:57:44 +00:00
},
colors: {
transparent: 'transparent',
current: 'currentColor',
vega: {
yellow: '#EDFF22',
pink: '#FF2D5E',
green: '#00F780',
red: '#FF261A',
},
red: {
DEFAULT: '#ED1515',
Feat/305 add console v2 first view screen (#424) * [#305] add initial landing dialog on markets page and fix some typos * [#305] market-list utils and generate schema * [#305] initial styling of the landing dialog and add arrows * [#305] routing to markets and add hover and market list tests * [#305] fix z-index on dialog overlay * [#305] default market shoulde be oldest market that is currently trading in continuous mode * [#305] refactor market-list library * [#305] add arrow unit tests * Update libs/market-list/src/lib/components/landing/landing-dialog.tsx Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com> * Update libs/market-list/src/lib/components/landing/select-market-list.tsx Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com> * Update libs/market-list/src/lib/components/landing/select-market-list.tsx Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com> * test: fix failing tests from homepage change * [#305] sort by id after sorting by date * test: increase timeout for failing tests in CI * [#305] destructuring all over the place and some code tweaks, arrows and percentage changes * [#305] update sparkline to show colour * [#305] fix order of market list * [#305] stretchedLink class plus a-tag href for navigation - accessibility updates * [#305] use href only and remove log * [#305] use bignumber.js for price calculations * [#305] change to bg-white/50 on dark mode overlay as asked from UX * [#305] change to bg-white/50 on dark mode overlay as asked from UX * [#305] toLocaleString fix * [#305] toLocaleString fix * [#305] add price-change-cell and use formatNumber * [#305] add extra test for select market list * Update apps/trading/specs/index.spec.tsx Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com> * [#305] use memo, sort by date and id lodash Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com> Co-authored-by: Joe <joe@vega.xyz>
2022-05-23 12:21:54 +00:00
dark: '#EB001B',
bar: 'rgba(47, 246, 139, 0.45)', // #2FF68B 45%
},
green: {
DEFAULT: '#26FF8A',
Feat/305 add console v2 first view screen (#424) * [#305] add initial landing dialog on markets page and fix some typos * [#305] market-list utils and generate schema * [#305] initial styling of the landing dialog and add arrows * [#305] routing to markets and add hover and market list tests * [#305] fix z-index on dialog overlay * [#305] default market shoulde be oldest market that is currently trading in continuous mode * [#305] refactor market-list library * [#305] add arrow unit tests * Update libs/market-list/src/lib/components/landing/landing-dialog.tsx Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com> * Update libs/market-list/src/lib/components/landing/select-market-list.tsx Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com> * Update libs/market-list/src/lib/components/landing/select-market-list.tsx Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com> * test: fix failing tests from homepage change * [#305] sort by id after sorting by date * test: increase timeout for failing tests in CI * [#305] destructuring all over the place and some code tweaks, arrows and percentage changes * [#305] update sparkline to show colour * [#305] fix order of market list * [#305] stretchedLink class plus a-tag href for navigation - accessibility updates * [#305] use href only and remove log * [#305] use bignumber.js for price calculations * [#305] change to bg-white/50 on dark mode overlay as asked from UX * [#305] change to bg-white/50 on dark mode overlay as asked from UX * [#305] toLocaleString fix * [#305] toLocaleString fix * [#305] add price-change-cell and use formatNumber * [#305] add extra test for select market list * Update apps/trading/specs/index.spec.tsx Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com> * [#305] use memo, sort by date and id lodash Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com> Co-authored-by: Joe <joe@vega.xyz>
2022-05-23 12:21:54 +00:00
dark: '#008545',
bar: 'rgba(47, 246, 139, 0.45)', // #2FF68B 45%
},
text: '#C7C7C7',
deemphasise: '#8A9BA8',
2022-03-07 13:27:17 +00:00
white: {
DEFAULT: '#FFF',
strong: '#FFF',
normal: '#F5F8FA',
muted: '#676767',
'02': shadeOfGray(2),
'05': shadeOfGray(5),
10: shadeOfGray(10),
25: shadeOfGray(25),
40: shadeOfGray(40),
60: shadeOfGray(60),
80: shadeOfGray(80),
95: shadeOfGray(95),
100: shadeOfGray(100),
2022-03-07 13:27:17 +00:00
},
black: {
DEFAULT: '#000',
strong: '#000',
normal: '#000',
muted: '#BFCCD6',
'02': shadeOfGray(100 - 2),
'05': shadeOfGray(100 - 5),
10: shadeOfGray(100 - 10),
25: shadeOfGray(100 - 25),
40: shadeOfGray(100 - 40),
60: shadeOfGray(100 - 60),
80: shadeOfGray(100 - 80),
95: shadeOfGray(100 - 95),
100: shadeOfGray(100 - 100),
2022-03-07 13:27:17 +00:00
},
2022-03-09 08:57:59 +00:00
blue: '#1DA2FB',
2022-02-23 17:57:44 +00:00
coral: '#FF6057',
orange: '#D9822B',
yellow: {
DEFAULT: '#EDFF22',
dark: '#474B0A', // yellow 0.3 opacity on black
2022-02-23 17:57:44 +00:00
},
danger: '#FF261A',
warning: '#FF7A1A',
success: '#26FF8A',
'danger-bg': '#9E0025', // for white text
2022-02-23 17:57:44 +00:00
},
spacing: {
0: '0px',
2: '0.125rem',
4: '0.25rem',
Feature/303 orderbook improvements (#312) * [#151] market-depth code cleanup * [#303] Make ask and bid relative volume bars relative to maximum bid or ask volume * [#151] align cmulative vol bars to left * [#151] replace orderbook zoom in zoom out buttons with dropdown * [#151] fill gaps in orderbook data * Order book mocks added * [#151] mark mid price in orderbook * [303] Show number in orderbook cumulative volume column * [#808] show indicative uncrossing volume instead of volume if market is in auction mode * Method for asserting order book style * [#303] Add test id attributes to orderbook cells * Cleanup steps after merge * Order book test passing * Change method name * Revert "[#151] fill gaps in orderbook data" This reverts commit 90ea4e4ab381748d990095a4c332f1c98205d8f9. * [#303] Orderbook rows render optimization * test: update feature with @todo tests Same tests can be found in Notion * [#303] Orderbook scroll to mid price * [#303] orderbook scroll to row pixel perfect alignment * [#303] Bring back best offer horizontal lines * [#303] Preserve center price level on row number change, adjust indicativePrice to resoluton * feat(orderbook): add storybook Refs: #303 * feat(orderbook): fix no rows handling Refs: #303 * feat(orderbook): add orderbook stories for auction and continous market Refs: #303 * feat(orderbook): add stories for empty orderbook Refs: #303 * feat(orderbook): fix footer position when there is no data Refs: #303 * feat(orderbook): seperate number of rows for buy and sell in storybook Refs: #303 * feat(orderbook): keep mid price in middle until user will scroll Refs: #303 * feat(orderbook): style scrollbar * feat(orderbook): style scrollbar * feat(orderbook): adjust gaps * feat(orderbook): adjust gaps * test: addition for autofilled order and mid price lines * fix: lint * feat(orderbook): make it posiible to write RTL tests * feat(orderbook): fix price focus, add unit tests * feat(orderbook): fix price scroll to mid proce, add unit tests * feat(orderbook): improvements - fix scrollbar colors in firefox - bring back resolution dropdown chevron - hide go to mid button when locked on mid price - right align ask vol bar - change grid gap to 5px - add vertical lines between columns - display "No data" if theis no orderbook data - align header labels to right * feat(orderbook): fix formatting * feat(orderbook): add 5px gap * feat(orderbook): improvements after code review * feat(orderbook): display full height vertical lines * fix: change in mid position * feat(orderbook): fix number cannot be converted to BigInt because it is not integer * feat(orderbook): fix TS2307 in trading-e2e caused by .module.scss import Co-authored-by: Joe <joe@vega.xyz>
2022-06-10 13:52:39 +00:00
5: '0.3125rem',
2022-02-23 17:57:44 +00:00
8: '0.5rem',
12: '0.75rem',
2022-03-02 09:32:22 +00:00
16: '1rem',
20: '1.25rem',
2022-03-02 09:32:22 +00:00
24: '1.5rem',
2022-02-23 17:57:44 +00:00
28: '1.75rem',
2022-03-02 09:32:22 +00:00
32: '2rem',
40: '2.5rem',
2022-02-23 17:57:44 +00:00
44: '2.75rem',
64: '4rem',
2022-02-23 17:57:44 +00:00
},
2022-03-04 16:21:24 +00:00
opacity: {
0: '0',
2: '0.02',
5: '0.05',
10: '0.1',
15: '0.15',
20: '0.2',
25: '0.25',
30: '0.3',
35: '0.35',
40: '0.4',
45: '0.45',
50: '0.5',
55: '0.55',
60: '0.6',
65: '0.65',
70: '0.7',
75: '0.75',
80: '0.8',
85: '0.85',
90: '0.9',
95: '0.95',
100: '1',
},
2022-02-23 17:57:44 +00:00
borderWidth: {
DEFAULT: '1px',
1: '1px',
2022-02-23 17:57:44 +00:00
4: '4px',
},
2022-03-16 12:57:24 +00:00
borderRadius: {
none: '0',
sm: '0.125rem',
DEFAULT: '0.225rem',
md: '0.3rem',
lg: '0.5rem',
full: '100%',
2022-03-16 12:57:24 +00:00
},
2022-02-23 17:57:44 +00:00
fontFamily: {
mono: ['Roboto Mono', ...defaultTheme.fontFamily.mono],
2022-02-23 17:57:44 +00:00
serif: defaultTheme.fontFamily.serif,
sans: [
'"Helvetica Neue"',
'-apple-system',
'BlinkMacSystemFont',
'"Segoe UI"',
'Roboto',
'Arial',
'"Noto Sans"',
'sans-serif',
'"Apple Color Emoji"',
'"Segoe UI Emoji"',
'"Segoe UI Symbol"',
'"Noto Color Emoji"',
],
alpha: [
'AlphaLyrae',
2022-02-23 17:57:44 +00:00
'"Helvetica Neue"',
'-apple-system',
'BlinkMacSystemFont',
'"Segoe UI"',
'Roboto',
'Arial',
'"Noto Sans"',
'sans-serif',
'"Apple Color Emoji"',
'"Segoe UI Emoji"',
'"Segoe UI Symbol"',
'"Noto Color Emoji"',
],
},
fontSize: {
2022-03-01 09:26:26 +00:00
h1: ['72px', { lineHeight: '92px', letterSpacing: '-0.01em' }],
h2: ['48px', { lineHeight: '64px', letterSpacing: '-0.01em' }],
h3: ['32px', { lineHeight: '40px', letterSpacing: '-0.01em' }],
2022-02-23 17:57:44 +00:00
2022-03-01 09:26:26 +00:00
h4: ['24px', { lineHeight: '36px', letterSpacing: '-0.01em' }],
h5: ['18px', { lineHeight: '28px', letterSpacing: '-0.01em' }],
2022-02-23 17:57:44 +00:00
'body-large': ['16px', '24px'],
body: ['14px', '20px'],
ui: ['14px', '20px'],
'ui-small': ['12px', '16px'],
2022-02-23 17:57:44 +00:00
},
Feat/63 Deal ticket (#82) * scaffold dealticket package, remove trading views from react-helpers * add deal ticket component, add intent utils, expand dialog and form group styles * add splash component, show market not found message if market doesnt exist * tidy up error handling * add handleError method for vega tx hook * add better testname for provider test, flesh out tests a bit more for deal ticket * Add unit tests for useVegaTransaction and useOrderSubmit hooks * add wrapper component for order dialog styles * add vega styled loader to ui toolkit and use in order dialog * add title prop to order dialog * split limit and market tickets into own files * add button radio component * revert dialog styles * move splash component to ui-toolkit, add story * convert intent to enum * Make button always type=button unless type prop is passed * inline filter logic for tif selector * add date-fns, add datetime to helpers * add order types to wallet package, make price undefined if order type is market * use enums in deal ticket logic * tidy up order state by moving submit and transaction hooks out of deal ticket * add comment for dialog styles * remove decimal from price input * add types package, delete old generated types from trading project * rename types package to graphql * update generate command to point to correct locations * fix use order submit test * use intent shadow helper * remove date-fns and format manually, update submit button error to use input-error * remove stray console.log
2022-03-17 19:35:46 +00:00
boxShadow: {
callout: '5px 5px 0 1px rgba(255, 255, 255, 0.05)',
focus: '0px 0px 0px 1px #FFFFFF, 0px 0px 3px 2px #FFE600',
'focus-dark': '0px 0px 0px 1px #000000, 0px 0px 3px 2px #FFE600',
radio: '1px 1px 0 0',
2022-02-23 17:57:44 +00:00
},
};