From e3bc04dfaa1e928fc27c2c0925f58ab65d769fec Mon Sep 17 00:00:00 2001 From: TrofimovAnton85 <98453427+TrofimovAnton85@users.noreply.github.com> Date: Thu, 5 Sep 2024 11:33:13 +0200 Subject: [PATCH] feat(drawer): act-1517 - updated panel to light theme (#1517) * feat(drawer): act-1517 - updated panel to light theme * feat(drawer): act-1517 - minor style fix * feat(drawer): act-1517 - added fixes for paddings --- .../InteractiveBox/styles.module.css | 57 ++++++++++++------- .../ParserOpenRPC/ModalDrawer/index.tsx | 7 +-- .../ModalDrawer/styles.module.css | 37 ++++++++---- .../ParserOpenRPC/global.module.css | 9 +++ 4 files changed, 74 insertions(+), 36 deletions(-) diff --git a/src/components/ParserOpenRPC/InteractiveBox/styles.module.css b/src/components/ParserOpenRPC/InteractiveBox/styles.module.css index 3ad7ea4669d..2809d0a9090 100644 --- a/src/components/ParserOpenRPC/InteractiveBox/styles.module.css +++ b/src/components/ParserOpenRPC/InteractiveBox/styles.module.css @@ -1,24 +1,43 @@ +:root { + --param-item-bg: #292a36; + --param-item-color: #fff; + --param-item-border-color: rgba(132, 140, 150, 1); + --column-item-type-color: rgba(187, 192, 197, 1); + --modal-footer-bg: #24272a; +} + +:root[data-theme="light"] { + --param-item-bg: #F2F4F6; + --param-item-color: #141618; + --param-item-border-color: #BBC0C5; + --column-item-type-color: #6A737D; + --modal-footer-bg: #fff; +} + .tableHeadingRow { display: flex; - border-top: 1px solid rgba(132, 140, 150, 1); + border-top: 1px solid var(--param-item-border-color); } .tableHeadingColumn { width: 50%; padding: 16px; line-height: 1.5; - background-color: #292a36; - color: #ffffff; + font-weight: 500; + background-color: var(--param-item-bg); + color: var(--param-item-color); } .tableRow { display: flex; - border-top: 1px solid rgba(132, 140, 150, 1); - border-bottom: 1px solid rgba(132, 140, 150, 1); + border-top: 1px solid var(--param-item-border-color); + border-bottom: 1px solid var(--param-item-border-color); + margin-top: -1px; } .tableColumn { width: 50%; line-height: 24px; - background-color: #292a36; - color: #ffffff; + background-color: var(--param-item-bg); + color: var(--param-item-color); + font-weight: 500; } .tableColumnParam { display: flex; @@ -27,6 +46,7 @@ padding: 12px 16px 12px 12px; border-left: 4px solid transparent; line-height: 28px; + font-size: 14px; } .tableColumnParamFocused { border-left: 4px solid rgba(16, 152, 252, 1); @@ -35,7 +55,7 @@ border-left: 4px solid rgba(224, 100, 112, 1); } .tableColumn:first-child { - border-right: 1px solid rgba(132, 140, 150, 1); + border-right: 1px solid var(--param-item-border-color); } .tableValueRow { display: flex; @@ -57,7 +77,7 @@ right: 0; padding-right: 28px; padding-bottom: 2px; - color: rgba(187, 192, 197, 1); + color: var(--column-item-type-color); line-height: 24px; font-size: 14px; } @@ -136,7 +156,7 @@ margin: 0; top: 35px; overflow: hidden; - border: 1px solid rgba(132, 140, 150, 1); + border: 1px solid var(--param-item-border-color); z-index: 2; } .dropdownListClosed { @@ -157,7 +177,7 @@ cursor: pointer; } .dropdownItem:not(:last-child) { - border-bottom: 1px solid rgba(132, 140, 150, 1); + border-bottom: 1px solid var(--param-item-border-color); } .tableFooterRow { position: fixed; @@ -166,12 +186,8 @@ padding: 16px; width: 100%; bottom: 0; -} -.tableFooterRowDark { - background-color: #24272a; -} -.tableFooterRowLight { - background-color: #f2f4f6; + background-color: var(--modal-footer-bg); + border-top: 1px solid var(--param-item-border-color); } .tableButton { display: flex; @@ -205,7 +221,8 @@ padding: 12px 72px 12px 16px; font-size: 14px; line-height: 24px; - color: #ffffff; + font-weight: 500; + color: var(--param-item-color); border-radius: 0; border: 2px solid transparent; text-overflow: ellipsis; @@ -272,7 +289,7 @@ padding-right: 28px; display: flex; align-items: center; - color: rgba(187, 192, 197, 1); + color: var(--column-item-type-color); font-size: 14px; cursor: pointer; } @@ -288,7 +305,7 @@ display: flex; align-items: center; padding: 12px; - border-bottom: 1px solid rgba(132, 140, 150, 1); + border-bottom: 1px solid var(--param-item-border-color); } .addItemBtn { display: flex; diff --git a/src/components/ParserOpenRPC/ModalDrawer/index.tsx b/src/components/ParserOpenRPC/ModalDrawer/index.tsx index e380a7ec50e..67167bbb78f 100644 --- a/src/components/ParserOpenRPC/ModalDrawer/index.tsx +++ b/src/components/ParserOpenRPC/ModalDrawer/index.tsx @@ -1,6 +1,5 @@ import React, { useState, useEffect, useRef } from "react"; import clsx from "clsx"; -import { useColorMode } from "@docusaurus/theme-common"; import styles from "./styles.module.css"; interface ModalDrawerProps { @@ -22,7 +21,6 @@ export const ModalDrawer = ({ }: ModalDrawerProps) => { const [showModal, setShowModal] = useState(isOpen); const contentRef = useRef(null); - const { colorMode } = useColorMode(); useEffect(() => { setShowModal(isOpen); @@ -42,10 +40,7 @@ export const ModalDrawer = ({ )} >