Files
Rabby/tailwind.config.js
kim be7a7b12bd feat: perps pro (#3393)
* feat: add ForkTsCheckerWebpackPlugin support and update package.json scripts

* fix: correct export and import statements for Props type in ActionGroup component

* chore: update postcss-loader to v5.3.0 and adjust dev script to prevent double rebuilds

* feat:init perps pro and import react-resizable-panels

* feat: trades and order book and coin info selector

* feat: trades

* fix: merge develop 0.93.67

* feat: add AccountActions

* feat: init trading panel

* wip

* feat: init market type trading panel

* wip

* fix: some slider dot

* wip

* feat: take and stop market and limit order

* feat: update history

* feat: twap done

* feat: close position

* fix: open scale order action and check

* feat: user info history and perps account select

* feat: user info modal and ui

* feat: add leverage modal in position info

* feat: DesktopPerpsInput init

* fix: update tp sl order

* fix: twap and updat e tp or sl order

* feat: chart volume and i18n

* feat: dark mode and dropdown

* fix: css and lint

* Merge remote-tracking branch 'origin/develop' into feat/perps-pro

* feat: openDeleteAgentModal and hook update

* fix: handleActionApproveStatus

* fix: update line tag

* fix: chart data reset and ready

* fix: sound player and toast

* fix: perps toast right bottom

* feat:add enable trading in hard wallet

* feat: limit order and close

* feat: update top nav from prediction

* fix: update ui and container

* feat: init deposit and withdraw in perps desktop

* feat: add edit market slippage modal

* feat: ui update and text and container

* feat: merge main desktop nav

* feat: get aggregationLevels option

* fix: handleSafeSetReference and agent expired auto send approve

* feat: container update in small screen

* feat: update popup type state and store coin in path params

* feat: auto resize in small screen

* fix: ui  css and container layout

* feat: add FixedSizeList in coin dropdown

* fix: calculateChangeValue in coin selector

* feat: trading panel container and tp & sl setting

* fix: formatTpOrSlPrice in 3400.02 and 150.014

* fix: history area and action modal

* fix: update version for market open

* fix: liq. price update calc in cross

* fix: css and ui

* fix: chart empty data and perps full icon

* feat: dropdown remove transition when trigger

* fix: update leverage & position orders & market est slippage

* feat: add fixed title in user info table

* fix: add order history and trade history

* feat: status bar and user info tabs switch

* feat: update trading panel

* feat: user info container and limit order tp or sl

* fix: add address in perps

* feat: scale and twap input validate

* fix: update ui

* fix: home container

* feat:tooltip and ui

* fix: tp or sl pnl calc and twap scale

* feat: add permission tips in not support region

* fix: debug code remove

* feat:  add fundingTips

* fix: user info calc max height

* feat: switch theme btn and liq.price

* feat: update perps fee

* fix: scaleOrders params tradeSize

* fix: color name

* fix: name update

* feat: liq price layout in small screen and desktop nav

* feat: update wallet in perps desktop page

* feat : update close pnl

* fix: numGrids validate in scale

* fix:  validate national value

* fix: update dark

* fix: css and ui

* fix: update perps sdk

* lint

---------

Co-authored-by: DMY <147dmy@gmail.com>
Co-authored-by: Hodor <lost1q84@gmail.com>
2026-01-23 15:34:22 +08:00

173 lines
3.8 KiB
JavaScript

const colors = require('tailwindcss/colors');
const tinycolor2 = require('tinycolor2');
const {
themeColors,
rabbyCssPrefix,
appThemeColors,
rabbyAppCssPrefix,
} = require('./src/constant/theme-colors');
const getRabbyColors = (colors, prefix) => {
return ['light', 'dark'].reduce(
(accu, theme) => {
Object.entries(colors[theme]).forEach(([cssvarKey, colorValue]) => {
// const splitorIdx = cssvarKey.indexOf('-');
// const group = cssvarKey.slice(0, splitorIdx);
// const suffix = cssvarKey.slice(splitorIdx + 1);
const tinyColor = tinycolor2(colorValue);
const alpha = tinyColor.getAlpha();
const hexValue =
alpha === 1 ? tinyColor.toHexString() : tinyColor.toHex8String();
if (!accu.auto[cssvarKey]) {
accu.auto[cssvarKey] = `var(--${prefix}${cssvarKey}, ${hexValue})`;
}
accu[theme][cssvarKey] = hexValue;
});
return accu;
},
{
light: {},
dark: {},
auto: {},
}
);
};
const rabbyColors = getRabbyColors(themeColors, rabbyCssPrefix);
const rabbyAppColors = getRabbyColors(appThemeColors, rabbyAppCssPrefix);
/** @type {import('tailwindcss').Config} */
module.exports = {
mode: 'jit',
purge: ['./src/ui/**/*.{ts,tsx,html}'],
theme: {
spacing: [
0,
1,
2,
4,
6,
8,
10,
12,
14,
16,
18,
20,
24,
28,
32,
40,
60,
80,
].reduce((m, n) => {
m[n] = `${n}px`;
return m;
}, {}),
screens: {
sm: { max: '600px' },
lg: { min: '600px' },
},
colors: {
transparent: 'transparent',
current: 'currentColor',
blue: {
from: '#8A78FD',
to: '#796BFD',
light: rabbyColors.light['blue-default'],
DEFAULT: '#796BFD',
purple: '#5F75FF',
},
black: '#707280',
green: '#27C193',
white: colors.white,
yellow: '#F29C1B',
orange: '#FFB020',
pink: '#F24822',
red: {
light: '#F24822',
DEFAULT: '#AF160E',
forbidden: '#EC5151',
},
gray: {
bg2: '#F5F6FA',
bg: '#F5F6FA',
divider: '#E5E9EF',
comment: '#B4BDCC',
content: '#707280',
subTitle: '#4B4D59',
title: '#13141A',
light: '#707880',
common: '#666666',
},
},
fontSize: {
12: [
'12px',
{
lineHeight: '14px',
},
],
13: '13px',
14: [
'14px',
{
lineHeight: '18px',
},
],
15: [
'15px',
{
lineHeight: '18px',
},
],
18: [
'18px',
{
lineHeight: '22px',
},
],
20: '20px',
24: [
'24px',
{
lineHeight: '28px',
},
],
28: [
'28px',
{
lineHeight: '33px',
},
],
},
/** @notice configuration here would override the default config above */
extend: {
fontWeight: {
510: '510',
},
colors: {
[`${rabbyCssPrefix.replace(/\-$/, '')}`]: rabbyColors.auto,
[`${'rabby-'.replace(/\-$/, '')}`]: rabbyColors.auto,
[`${'-r-'.replace(/\-$/, '')}`]: rabbyColors.auto,
[`light-${rabbyCssPrefix.replace(/\-$/, '')}`]: rabbyColors.light,
[`dark-${rabbyCssPrefix.replace(/\-$/, '')}`]: rabbyColors.dark,
[`${rabbyAppCssPrefix.replace(/\-$/, '')}`]: rabbyAppColors.auto,
[`light-${rabbyAppCssPrefix.replace(/\-$/, '')}`]: rabbyAppColors.light,
[`dark-${rabbyAppCssPrefix.replace(/\-$/, '')}`]: rabbyAppColors.dark,
},
},
},
// use class insteadof media-query prefers-color-scheme
// see https://v2.tailwindcss.com/docs/dark-mode
darkMode: 'class',
important: true,
};