Skip to content

Commit

Permalink
Clean up some CSS: less composition
Browse files Browse the repository at this point in the history
  • Loading branch information
draperunner committed Mar 9, 2024
1 parent cd692d2 commit 3ee47f3
Show file tree
Hide file tree
Showing 18 changed files with 30 additions and 35 deletions.
12 changes: 11 additions & 1 deletion src/base-styles/main.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
body {
margin: 0;
background-color: #ecf0f1;
font-family: "Open Sans", sans-serif;
font-family: var(--font-body);
color: var(--gray);
}

img {
Expand All @@ -25,3 +26,12 @@ a:hover {
color: #3498db;
text-decoration: underline;
}

h1,
h2,
h3,
h4,
h5,
h6 {
font-family: var(--font-header);
}
12 changes: 0 additions & 12 deletions src/base-styles/types.module.css

This file was deleted.

4 changes: 4 additions & 0 deletions src/base-styles/typography.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
:root {
--font-header: "Fredoka One", cursive;
--font-body: "Open Sans", sans-serif;
}
1 change: 0 additions & 1 deletion src/components/Buttons/Alternative/Alternative.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.alternativeBase {
composes: base from "../BaseButton.module.css";
composes: bodyFont from "../../../base-styles/types.module.css";
padding: 20px;
display: inline-block;
margin: 3px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.category {
composes: base from "../BaseButton.module.css";
composes: headerFont from "../../../base-styles/types.module.css";
composes: white from "../../../base-styles/colors.module.css";
composes: orangeLightBackground from "../../../base-styles/colors.module.css";
composes: yellowBackgroundHover from "../../../base-styles/colors.module.css";
composes: yellowBackgroundFocus from "../../../base-styles/colors.module.css";
composes: darkGrayHover from "../../../base-styles/colors.module.css";
composes: darkGrayFocus from "../../../base-styles/colors.module.css";
font-family: var(--font-header);
text-transform: uppercase;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.result {
composes: base from "../BaseButton.module.css";
composes: bodyFont from "../../../base-styles/types.module.css";
composes: white from "../../../base-styles/colors.module.css";
composes: greenLightBackground from "../../../base-styles/colors.module.css";
composes: darkGrayHover from "../../../base-styles/colors.module.css";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
.standard {
composes: base from "../BaseButton.module.css";
composes: hyphenate;
composes: bodyFont from "../../../base-styles/types.module.css";
composes: white from "../../../base-styles/colors.module.css";
composes: bodyFontColor from "../../../base-styles/types.module.css";
composes: blueBackground from "../../../base-styles/colors.module.css";
composes: blueLightBackgroundHover from "../../../base-styles/colors.module.css";
composes: blueLightBackgroundFocus from "../../../base-styles/colors.module.css";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Jumbotron/Jumbotron.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}

.title {
composes: headerFont from "../../base-styles/types.module.css";
font-family: var(--font-header);
composes: blue from "../../base-styles/colors.module.css";
font-size: 63px;
font-weight: 500;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Jumbotron/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const Jumbotron = (props: Props): JSX.Element => {
}))}
/>
) : null}
<h3 className={styles.subtitle}>{subtitle()}</h3>
<p className={styles.subtitle}>{subtitle()}</p>
</div>
);
};
Expand Down
7 changes: 3 additions & 4 deletions src/components/Kitem/Kitem.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
}

.kitem {
composes: bodyFont from "../../base-styles/types.module.css";
margin: 5px 5px 30px;
padding: 0;
white-space: normal;
Expand Down Expand Up @@ -48,15 +47,15 @@ a.kitem:hover {
}

.head {
composes: headerFont from "../../base-styles/types.module.css";
font-family: var(--font-header);
width: 100%;
height: 100%;
padding: 8px 0;
border-top-left-radius: 0.5rem;
border-top-right-radius: 0.5rem;
}

.head h3 {
.head div {
font-size: 24px;
margin-top: 20px;
margin-bottom: 10px;
Expand Down Expand Up @@ -151,7 +150,7 @@ a.kitem:hover {
margin: 5px 0;
}

.head h3 {
.head div {
font-size: 18px;
margin-top: 10px;
margin-bottom: 5px;
Expand Down
4 changes: 2 additions & 2 deletions src/components/Kitem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const Kitem = (props: Props): JSX.Element => {
return (
<div className={className}>
<div className={styles[`${props.color}head`]}>
<h3>{props.head || ""}</h3>
<div>{props.head || ""}</div>
</div>
<div className={styles.body}>
<p>{props.body}</p>
Expand All @@ -51,7 +51,7 @@ const Kitem = (props: Props): JSX.Element => {
onClick={props.onClick}
>
<div className={styles[`${props.color}head`]}>
<h3>{props.head}</h3>
<div>{props.head}</div>
</div>
<div className={styles.body}>
<p>{props.body}</p>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar/Navbar.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.navbar {
composes: blue from "../../base-styles/colors.module.css";
composes: headerFont from "../../base-styles/types.module.css";
font-family: var(--font-header);
margin-bottom: 20px;
background: none;
border-radius: 0;
Expand Down
2 changes: 1 addition & 1 deletion src/containers/About/About.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

.title {
composes: blue from "../../base-styles/colors.module.css";
composes: headerFont from "../../base-styles/types.module.css";
font-family: var(--font-header);
letter-spacing: 2px;
line-height: 40px;
font-size: 63px;
Expand Down
4 changes: 1 addition & 3 deletions src/containers/Questions/Explanation/Explanation.module.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
.wrapper {
composes: bodyFont from "../../../base-styles/types.module.css";
composes: bodyFontColor from "../../../base-styles/types.module.css";
margin: 3px;
}

.header {
composes: headerFont from "../../../base-styles/types.module.css";
composes: blue from "../../../base-styles/colors.module.css";
font-family: var(--font-header);
font-weight: 500;
margin-bottom: 2px;
}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Questions/Question/Question.module.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.question {
composes: bodyFontColor from "../../../base-styles/types.module.css";
margin: 0 20px;
font-size: 24px;
font-weight: 500;
font-family: "Open Sans", sans-serif;
}

@media (max-width: 767px) {
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Questions/Question/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface Props {

const Question = (props: Props): JSX.Element => (
<MathElement>
<h3
<h1
className={styles.question}
dangerouslySetInnerHTML={{ __html: sanitize(props.text) }}
/>
Expand Down
3 changes: 1 addition & 2 deletions src/containers/Result/Result.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.header {
composes: headerFont from "../../base-styles/types.module.css";
composes: bodyFontColor from "../../base-styles/types.module.css";
font-family: var(--font-header);
font-size: 36px;
font-weight: 500;
margin: 10px 0 0;
Expand Down
1 change: 1 addition & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import "katex";
import "katex/dist/katex.min.css";

import "./base-styles/colors.css";
import "./base-styles/typography.css";
import "./base-styles/main.css";
import "./auth";

Expand Down

0 comments on commit 3ee47f3

Please sign in to comment.