Skip to content

Commit

Permalink
start working on dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkrives committed Oct 17, 2018
1 parent 51fa665 commit 79ac5ec
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 19 deletions.
3 changes: 1 addition & 2 deletions modules/gob-web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ let GlobalStyle = createGlobalStyle`
html {
font-family: var(--sans-font-stack);
color: var(--text-color);
box-sizing: border-box;
min-height: 100vh;
Expand All @@ -31,6 +29,7 @@ let GlobalStyle = createGlobalStyle`
body {
background: var(--background);
color: var(--text-color);
height: 100%;
}
Expand Down
5 changes: 3 additions & 2 deletions modules/gob-web/components/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ export const RaisedButton = styled(BaseButton)`
&[disabled] {
cursor: default;
color: var(--gray-500);
background-color: var(--disabled-background);
color: var(--disabled-foreground);
}
`

Expand All @@ -80,7 +81,7 @@ export const FlatButton = styled(BaseButton)`
&[disabled] {
cursor: default;
color: var(--disabled-foreground--light);
color: var(--disabled-foreground);
&:hover,
&:focus,
Expand Down
2 changes: 1 addition & 1 deletion modules/gob-web/components/card.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import styled from 'styled-components'

export const Card = styled.div`
box-shadow: 0 2px 4px 0 rgba(14, 30, 37, 0.12);
background-color: white;
background-color: var(--card-background);
border-radius: var(--base-border-radius);
`
6 changes: 0 additions & 6 deletions modules/gob-web/index.scss

This file was deleted.

2 changes: 1 addition & 1 deletion modules/gob-web/modules/course-table/semester.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Container = styled.div`
--background-color: var(--white);
--background-color-hover: var(--gray-200);
--separator-color: var(--gray-200);
--separator-color: rgba(0,0,0,0.4);
&.loading {
}
Expand Down
20 changes: 15 additions & 5 deletions modules/gob-web/modules/student/student-summary.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,29 @@
text-align: center;
hyphens: none;
font-variant-numeric: oldstyle-nums tabular-nums;
text-shadow: 0 1px rgba(white, 0.5);
font-size: 0.85em;
padding: calc(var(--block-edge-padding) * 2);

&.cannot-graduate .graduation-message {
color: var(--deep-orange-500);
body:not(.dark) & {
color: var(--deep-orange-500);
}
}

&.can-graduate .graduation-message {
color: var(--light-green-800);
body:not(.dark) & {
color: var(--light-green-800);
}
}

&.can-graduate {
background-color: var(--light-green-50);
body:not(.dark) & {
background-color: var(--light-green-50);
}
&::selection {
background-color: var(--light-green-900);
body:not(.dark) & {
background-color: var(--light-green-900);
}
}
}

Expand All @@ -31,6 +38,9 @@

.student-summary--header {
color: var(--black);
body.dark & {
color: var(--inherit);
}

margin-bottom: calc(var(--block-edge-padding) * 2);
font-style: italic;
Expand Down
15 changes: 15 additions & 0 deletions modules/gob-web/styles/css-variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,19 @@
--semester-spacing: 4px;
--semester-side-padding: calc(var(--block-edge-padding) * 1.5);
--semester-padding: var(--block-edge-padding) var(--semester-side-padding);

--disabled-foreground: var(--disabled-foreground--light);
--disabled-background: var(--disabled-background--light);

--card-background: var(--white);
}

body.dark {
--background: #0e1e25;
--text-color: rgb(250,250,250);

--disabled-foreground: var(--disabled-foreground--dark);
--disabled-background: var(--disabled-background--dark);

--card-background: #717e83;
}
2 changes: 1 addition & 1 deletion modules/gob-web/styles/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@mixin card() {
box-shadow: 0 2px 4px 0 rgba(14, 30, 37, 0.12);
background-color: var(--background-color, white);
background-color: var(--card-background);
border-radius: var(--base-border-radius);
}

Expand Down
2 changes: 1 addition & 1 deletion modules/gob-web/theme/mixins.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const materialShadow = `
`

export const baseCard = css`
background-color: var(--background-color, white);
background-color: var(--card-background);
border-radius: var(--base-border-radius);
`

Expand Down
2 changes: 2 additions & 0 deletions modules/gob-web/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ const html = ({cssHref, scriptSrc}) => {
${cssLink}
<script async type="module" src="${scriptSrc}"></script>
<body class="dark">
<main id="gobbldygook"></main>
</body>
</html>
`.trim()
}
Expand Down

0 comments on commit 79ac5ec

Please sign in to comment.