Skip to content

Commit 43828b0

Browse files
committed
fix: global styles
1 parent 63a1f46 commit 43828b0

File tree

3 files changed

+12
-121
lines changed

3 files changed

+12
-121
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@solved-ac/ui-react",
3-
"version": "0.0.1-alpha.28",
3+
"version": "0.0.1-alpha.29",
44
"description": "React component library used by solved.ac",
55
"author": "shiftpsh",
66
"license": "MIT",
@@ -71,6 +71,7 @@
7171
"react-scripts": "^5.0.1",
7272
"storybook-addon-styled-component-theme": "^2.0.0",
7373
"styled-components": "^5.3.5",
74+
"styled-reset": "^4.4.0",
7475
"typescript": "^4.6.4"
7576
},
7677
"files": [

src/styles/GlobalStyles.ts

Lines changed: 5 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { buttons, normalize, textInputs, transparentize } from 'polished'
1+
import { buttons, textInputs, transparentize } from 'polished'
22
import { createGlobalStyle } from 'styled-components'
3+
import reset from 'styled-reset'
34
import {
45
buttonVariables,
56
cardVariables,
@@ -20,7 +21,7 @@ const componentGlobalStyles = [
2021
].map(({ styles }) => styles)
2122

2223
export const SolvedGlobalStyles = createGlobalStyle<{ theme: SolvedTheme }>`
23-
${normalize()}
24+
${reset}
2425
2526
* {
2627
box-sizing: border-box;
@@ -31,12 +32,7 @@ export const SolvedGlobalStyles = createGlobalStyle<{ theme: SolvedTheme }>`
3132
html {
3233
font-family: ${({ theme }) => theme.typography.paragraph};
3334
font-weight: 400;
34-
-ms-text-size-adjust: 100%;
35-
-webkit-text-size-adjust: 100%;
36-
margin: 0;
37-
padding: 0;
3835
width: 100%;
39-
line-height: 1.6;
4036
overflow-x: hidden;
4137
background: ${({ theme }) => theme.color.background.footer};
4238
${({ theme }) =>
@@ -46,6 +42,7 @@ export const SolvedGlobalStyles = createGlobalStyle<{ theme: SolvedTheme }>`
4642
body {
4743
margin: 0;
4844
width: 100%;
45+
line-height: 1.6;
4946
overflow-x: hidden;
5047
color: ${({ theme }) => theme.color.text.primary.main};
5148
background: ${({ theme }) => theme.color.background.page};
@@ -54,33 +51,16 @@ export const SolvedGlobalStyles = createGlobalStyle<{ theme: SolvedTheme }>`
5451
theme.color.background.page};
5552
}
5653
57-
h1, h2, h3, h4, h5, h6 {
58-
margin: 0;
59-
}
60-
6154
::selection {
6255
color: ${({ theme }) => theme.color.background.page};
6356
background: ${({ theme }) =>
6457
transparentize(0.5, theme.color.text.primary.main)};
6558
}
6659
67-
textarea,
68-
input,
69-
select {
60+
${textInputs()} {
7061
font-family: inherit;
7162
line-height: 1.3;
7263
font-size: 1rem;
73-
}
74-
75-
textarea {
76-
padding: 8px;
77-
background: ${({ theme }) => theme.color.background.footer};
78-
color: ${({ theme }) => theme.color.text.primary.main};
79-
border: ${({ theme }) => theme.styles.border()};
80-
border-radius: 8px;
81-
}
82-
83-
${textInputs()} {
8464
width: 100%;
8565
max-width: 400px;
8666
height: auto;
@@ -98,42 +78,6 @@ export const SolvedGlobalStyles = createGlobalStyle<{ theme: SolvedTheme }>`
9878
text-align: inherit;
9979
}
10080
101-
option {
102-
color: ${({ theme }) => theme.color.text.primary.main};
103-
}
104-
105-
code,
106-
pre {
107-
font-family: ${({ theme }) => theme.typography.code};
108-
background: ${({ theme }) => theme.color.background.footer};
109-
}
110-
111-
pre {
112-
padding: 16px;
113-
font-size: 0.9em;
114-
overflow-x: auto;
115-
}
116-
117-
pre code {
118-
background: initial;
119-
}
120-
121-
blockquote {
122-
margin: 0;
123-
padding: 0 1em;
124-
color: #60666d;
125-
border-left: 3px solid #ebebee;
126-
}
127-
128-
iframe {
129-
max-width: 100%;
130-
}
131-
132-
/* TODO remove named classes */
133-
.pc_hidden {
134-
display: none;
135-
}
136-
13781
/* TODO remove named classes */
13882
img.emoji {
13983
height: 1em;
@@ -147,60 +91,6 @@ export const SolvedGlobalStyles = createGlobalStyle<{ theme: SolvedTheme }>`
14791
overflow: hidden !important;
14892
}
14993
150-
table {
151-
width: 100%;
152-
border-collapse: collapse;
153-
th {
154-
background: ${({ theme }) => theme.color.background.table.header};
155-
color: ${({ theme }) => theme.color.text.primary.inverted};
156-
padding: 8px;
157-
}
158-
td {
159-
padding: 8px;
160-
}
161-
tr {
162-
&:nth-child(odd) {
163-
background: ${({ theme }) => theme.color.background.page};
164-
}
165-
&:nth-child(even) {
166-
background: ${({ theme }) => theme.color.background.table.main};
167-
}
168-
}
169-
}
170-
171-
a {
172-
color: inherit;
173-
&.nounderline {
174-
text-decoration: none;
175-
}
176-
&.hover_underline {
177-
text-decoration: none;
178-
&:hover {
179-
text-decoration: underline;
180-
}
181-
}
182-
}
183-
184-
ul {
185-
list-style-type: "✓ ";
186-
& > li::marker {
187-
color: ${({ theme }) => theme.color.solvedAc};
188-
}
189-
}
190-
191-
/* TODO remove named classes */
192-
.nounderline a {
193-
text-decoration: none;
194-
}
195-
196-
/* TODO remove named classes */
197-
.hover_underline a {
198-
text-decoration: none;
199-
&:hover {
200-
text-decoration: underline;
201-
}
202-
}
203-
20494
/* TODO remove named classes */
20595
.contents {
20696
position: relative;
@@ -260,11 +150,6 @@ export const SolvedGlobalStyles = createGlobalStyle<{ theme: SolvedTheme }>`
260150
color: #b300e0;
261151
}
262152
263-
/* TODO remove named classes */
264-
.description {
265-
color: ${({ theme }) => theme.color.text.secondary.main};
266-
}
267-
268153
::-webkit-scrollbar {
269154
width: 12px;
270155
}

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9331,6 +9331,11 @@ styled-components@^5.3.5:
93319331
shallowequal "^1.1.0"
93329332
supports-color "^5.5.0"
93339333

9334+
styled-reset@^4.4.0:
9335+
version "4.4.0"
9336+
resolved "https://registry.yarnpkg.com/styled-reset/-/styled-reset-4.4.0.tgz#29bc355a4f592cd73cc1828c6aa47a5187aaead0"
9337+
integrity sha512-dJlY3kiB2Jh7Xq7cNW2JEjZ6a1winqz9NJQRF9EMHgEZ09b0dFTgBVDvtJD+7XS2EbuCrbDABtWfiGp05qDJcw==
9338+
93349339
stylehacks@^5.1.0:
93359340
version "5.1.0"
93369341
resolved "https://registry.npmjs.org/stylehacks/-/stylehacks-5.1.0.tgz"

0 commit comments

Comments
 (0)