From af8b0caf4c9eccc7630cddfc94a6806b592e244a Mon Sep 17 00:00:00 2001 From: George Adams Date: Wed, 18 Jan 2023 12:52:38 +0000 Subject: [PATCH] linter fixes --- .github/linters/.stylelintrc.json | 5 +- src/components/CodeBox/index.module.scss | 14 +-- src/components/CodeBox/index.tsx | 3 - src/components/CodeBox/light.module.scss | 127 ++++++++++++----------- src/components/Layout/layout.scss | 2 + 5 files changed, 77 insertions(+), 74 deletions(-) diff --git a/.github/linters/.stylelintrc.json b/.github/linters/.stylelintrc.json index 3e13a08d49..b21680998b 100644 --- a/.github/linters/.stylelintrc.json +++ b/.github/linters/.stylelintrc.json @@ -7,6 +7,9 @@ "number-leading-zero": null, "color-function-notation": null, "no-descending-specificity": null, - "selector-class-pattern": null + "selector-class-pattern": null, + "scss/at-import-partial-extension": null, + "property-no-vendor-prefix": null, + "selector-pseudo-class-no-unknown": null } } diff --git a/src/components/CodeBox/index.module.scss b/src/components/CodeBox/index.module.scss index 57f54d7c4a..c6d6a4aa91 100644 --- a/src/components/CodeBox/index.module.scss +++ b/src/components/CodeBox/index.module.scss @@ -1,8 +1,8 @@ -@import './light.module.scss'; +@import "./light.module.scss"; -%baseStyles { +%base-styles { border-radius: 0.3rem; - font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 1em; -webkit-hyphens: none; @@ -25,7 +25,7 @@ } .code { - @extend %baseStyles; + @extend %base-styles; font-weight: var(--font-weight-light); padding: 0 6px; @@ -33,7 +33,7 @@ } .pre { - @extend %baseStyles; + @extend %base-styles; padding: 0 !important; @@ -54,7 +54,7 @@ span { background-color: var(--black4); - border-radius: 0 0 0.3rem 0; + border-radius: 0 0 0.3rem; color: var(--black9); } @@ -77,7 +77,7 @@ :global(.light) { .pre { - @include lightStyles; + @include light-styles; } .code { diff --git a/src/components/CodeBox/index.tsx b/src/components/CodeBox/index.tsx index 451f73f2c5..c07563b8d3 100644 --- a/src/components/CodeBox/index.tsx +++ b/src/components/CodeBox/index.tsx @@ -23,7 +23,6 @@ const CodeBox = ({ children: { props } }: Props): JSX.Element => { const [parsedCode, setParsedCode] = useState(''); const [copied, copyText] = useCopyToClipboard(); - // eslint-disable-next-line react/prop-types const className = props.className || 'text'; // Language Matches in class @@ -45,7 +44,6 @@ const CodeBox = ({ children: { props } }: Props): JSX.Element => { setParsedCode( highlight(stringCode, prismLanguage, language) ); - // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return ( @@ -58,7 +56,6 @@ const CodeBox = ({ children: { props } }: Props): JSX.Element => {
diff --git a/src/components/CodeBox/light.module.scss b/src/components/CodeBox/light.module.scss index c59493c4fc..bbaebccdb3 100644 --- a/src/components/CodeBox/light.module.scss +++ b/src/components/CodeBox/light.module.scss @@ -1,76 +1,77 @@ -@mixin lightStyles { - background: var(--black2); - color: black; - - :global .token { - &.comment, - &.prolog, - &.doctype, - &.cdata { +@mixin light-styles { + background: var(--black2); + color: black; + + :global .token { + &.comment, + &.prolog, + &.doctype, + &.cdata { color: slategray; - } - - &.namespace { + } + + &.namespace { opacity: 0.7; - } - - &.property, - &.tag, - &.boolean, - &.number, - &.constant, - &.symbol, - &.deleted { + } + + &.property, + &.tag, + &.boolean, + &.number, + &.constant, + &.symbol, + &.deleted { color: #905; - } - - &.selector, - &.attr-name, - &.char, - &.builtin, - &.inserted { + } + + &.selector, + &.attr-name, + &.char, + &.builtin, + &.inserted { color: #690; - } - - &.entity, - &.url { - background: hsla(0, 0%, 100%, 0.5); + } + + &.entity, + &.url { + background: hsla(0deg, 0%, 100%, 50%); color: #9a6e3a; - } - - &.atrule, - &.attr-value, - &.keyword { + } + + &.atrule, + &.attr-value, + &.keyword { color: #07a; - } - - &.function, - &.class-name { + } + + &.function, + &.class-name { color: #dd4a68; - } - - &.regex, - &.important, - &.variable { + } + + &.regex, + &.important, + &.variable { color: #e90; - } - - &.important, - &.bold { + } + + &.important, + &.bold { font-weight: var(--font-weight-vold); - } - &.italic { + } + + &.italic { font-style: italic; - } - - &.entity { + } + + &.entity { cursor: help; - } - - &.punctuation, - &.operator, - &.string { + } + + &.punctuation, + &.operator, + &.string { background-color: var(--black2); - } } - } \ No newline at end of file + } +} diff --git a/src/components/Layout/layout.scss b/src/components/Layout/layout.scss index 876bc1c255..4910217a69 100644 --- a/src/components/Layout/layout.scss +++ b/src/components/Layout/layout.scss @@ -12,6 +12,7 @@ $secondary: #dadada; } body { + --black2: #e9edf0; --black4: #cbd4d9; --black9: #2c3437; --brand4: #c52158; @@ -22,6 +23,7 @@ body { --color-fill-banner: #9992; --color-text-primary: var(--black9); --color-text-accent: var(--color-brand-primary); + --font-weight-light: 300; background-color: var(--bg);