From 5f9ec5e9927ea83612cdf8c35b2077ee76a0d1f3 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Tue, 31 Aug 2021 03:44:26 -0300 Subject: [PATCH] Start theme extraction work; extract from/to colors --- src/components/DecoratedAddressLink.tsx | 12 +++++++----- src/index.css | 9 +++++++++ src/transaction/Details.tsx | 4 ++-- tailwind.config.js | 25 +++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 7 deletions(-) diff --git a/src/components/DecoratedAddressLink.tsx b/src/components/DecoratedAddressLink.tsx index a325343..0b38fab 100644 --- a/src/components/DecoratedAddressLink.tsx +++ b/src/components/DecoratedAddressLink.tsx @@ -41,11 +41,13 @@ const DecoratedAddresssLink: React.FC = ({ return (
{creation && ( diff --git a/src/index.css b/src/index.css index b5c61c9..9333e63 100644 --- a/src/index.css +++ b/src/index.css @@ -1,3 +1,12 @@ @tailwind base; @tailwind components; @tailwind utilities; + +@layer base { + :root { + --color-from-border: 254, 226, 226; + --color-from-text: 220, 38, 38; + --color-from-fill: 254, 242, 242; + --color-to-fill: 236, 253, 245; + } +} diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index 1f3cd65..6f46e7f 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -176,7 +176,7 @@ const Details: React.FC = ({ Ether{" "} {!txData.value.isZero() && ethUSDPrice && ( - + )} @@ -266,7 +266,7 @@ const Details: React.FC = ({
Ether{" "} {ethUSDPrice && ( - + { + if (opacityValue !== undefined) { + return `rgba(var(${variableName}), ${opacityValue})`; + } + return `rgb(var(${variableName}))`; + }; +} + module.exports = { purge: ["./src/**/*.{js,jsx,ts,tsx}", "./public/index.html"], darkMode: false, // or 'media' or 'class' @@ -19,6 +28,22 @@ module.exports = { balance: ["Fira Code"], blocknum: ["Roboto"], }, + borderColor: { + skin: { + from: withOpacity("--color-from-border"), + }, + }, + textColor: { + skin: { + from: withOpacity("--color-from-text"), + }, + }, + backgroundColor: { + skin: { + from: withOpacity("--color-from-fill"), + to: withOpacity("--color-to-fill"), + }, + }, }, }, variants: {