From 6da12fcb101cc6d58541679eecbd9a899aeed488 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Fri, 2 Sep 2022 21:41:09 +0800 Subject: [PATCH] style: modify select style. --- src/index.tsx | 4 +++- src/pages/home/theme.tsx | 19 ++++++++++++++++++- src/store/context.tsx | 3 ++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 909d2d4..e87fa18 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -45,7 +45,9 @@ export const GlobalStyle = createGlobalStyle` -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } - * { + *, + *::before, + *::after { box-sizing: border-box; } `; diff --git a/src/pages/home/theme.tsx b/src/pages/home/theme.tsx index 597079d..d02f2cd 100644 --- a/src/pages/home/theme.tsx +++ b/src/pages/home/theme.tsx @@ -4,7 +4,24 @@ import styled from 'styled-components'; import { Context } from '../../store/context'; const Select = styled.select` - max-width: 3rem; + max-width: 4rem; + padding: 0; + appearance: none; + background-color: var(--color-border-muted); + border: none; + padding: 0 0.2rem 0 0.2rem; + margin: 0; + width: 100%; + font-family: inherit; + font-size: 0.3rem; + outline: none; + height: 1.15rem; + cursor: inherit; + line-height: inherit; + border-radius: 0.2rem; + &::-ms-expand { + display: none; + } `; const ThemeView: React.FC<{ command: ICommand; editorProps: IMarkdownEditor & ToolBarProps }> = (props) => { diff --git a/src/store/context.tsx b/src/store/context.tsx index 59ef522..c39602d 100644 --- a/src/store/context.tsx +++ b/src/store/context.tsx @@ -13,7 +13,8 @@ import { okaidia } from '@uiw/codemirror-theme-okaidia'; import { sublime } from '@uiw/codemirror-theme-sublime'; import { xcodeLight, xcodeDark } from '@uiw/codemirror-theme-xcode'; -export const themes = { abcdef, androidstudio, atomone, bbedit, bespin, darcula, dracula, duotoneLight, duotoneDark, eclipse, +export const themes = { + abcdef, androidstudio, atomone, bbedit, bespin, darcula, dracula, duotoneLight, duotoneDark, eclipse, githubLight, githubDark, okaidia, sublime, xcodeLight, xcodeDark }