Skip to content

Commit

Permalink
refactor(client): standardize dark-light CSS format (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
fushar authored Dec 30, 2023
1 parent dafd335 commit 9c40925
Show file tree
Hide file tree
Showing 18 changed files with 382 additions and 337 deletions.
8 changes: 0 additions & 8 deletions judgels-client/src/components/Card/Card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,3 @@
margin-bottom: 10px;
overflow-x: auto;
}

.bp5-dark .bp5-card {
background-color: #30404d;
box-shadow:
0 0 0 1px rgba(16, 22, 26, 0.4),
0 0 0 rgba(16, 22, 26, 0),
0 0 0 rgba(16, 22, 26, 0);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@

.form-status {
float: right;

label {
float: left;
width: initial;
line-height: 30px;
margin-right: 5px;
}
.form-group-select {

.form-group__select {
float: left;
width: initial;
}
}

button {
float: right;
margin-left: 5px;
}
}
8 changes: 4 additions & 4 deletions judgels-client/src/components/ContentCard/ContentCard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
margin-bottom: 10px;
overflow: auto;

.bp5-dark & {
box-shadow: 0 0 0 0.5px $dark-secondary-background-color !important;
}

h3 {
margin-bottom: 5px;
}
}

.bp5-dark .content-card {
box-shadow: 0 0 0 0.5px #5c7080 !important;
}

.content-card__section {
margin-bottom: 15px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
.content-card-link:hover {
cursor: pointer;
text-decoration: none;
}

.bp5-light .content-card-link:hover {
background-color: $secondary-background-color;
}
.bp5-light & {
background-color: $secondary-background-color;
}

.bp5-dark .content-card-link:hover {
background-color: $dark-secondary-background-color;
.bp5-dark & {
background-color: $dark-secondary-background-color;
}
}

.content-card-link__content {
Expand Down
42 changes: 21 additions & 21 deletions judgels-client/src/components/Header/Header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@

.header {
height: 50px;
}
color: white;

.bp5-light .header {
background-color: $primary-color !important;
height: 50px;
}
.bp5-light & {
background-color: $primary-color !important;
height: 50px;
}

.bp5-dark .header {
color: $dark-text-color !important;
background-color: $dark-blue-main-background-color !important;
box-shadow:
0 0 0 1px rgba(17, 20, 24, 0.1),
0 1px 1px rgba(17, 20, 24, 0.2);
}
.bp5-dark & {
color: $dark-text-color !important;
background-color: $dark-blue-main-background-color !important;
box-shadow:
0 0 0 1px rgba(17, 20, 24, 0.1),
0 1px 1px rgba(17, 20, 24, 0.2);
}

.bp5-dark .header a {
color: $dark-text-color !important;
}
a {
color: white;

.header,
.header a {
color: white;
}
.bp5-dark & {
color: $dark-text-color !important;
}

.header a:hover {
text-decoration: none;
&:hover {
text-decoration: none;
}
}
}

.header__wrapper {
Expand Down
39 changes: 18 additions & 21 deletions judgels-client/src/components/HtmlText/HtmlText.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,27 @@
cursor: pointer;
font-family: $accent-font;
font-weight: bold;
}

.spoiler:hover {
background-color: #e7e7e7;
}
.bp5-dark & {
background-color: $dark-secondary-background-color;
}

.spoiler .spoiler-content {
display: none;
border-top: 1px solid;
margin-top: 5px;
padding-top: 15px;
font-family: $primary-font;
font-style: normal;
font-weight: normal;
}
}
&:hover {
background-color: #e7e7e7;

.bp5-dark .html-text {
.spoiler {
background-color: #5c7080;
border: 2px dashed $gray5;
}
.bp5-dark & {
background-color: $dark-background-color;
}
}

.spoiler:hover {
background-color: $dark-background-color;
.spoiler-content {
display: none;
border-top: 1px solid;
margin-top: 5px;
padding-top: 15px;
font-family: $primary-font;
font-style: normal;
font-weight: normal;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function ProblemStatementCard({ alias, statement: { title, text }, limits
{alias ? `${alias}. ` : ''}
{title}
</h2>
<HTMLTable condensed className="programming-problem-statement__limits">
<HTMLTable compact className="programming-problem-statement__limits">
<tbody>
<tr>
<td>Time limit</td>
Expand Down
98 changes: 49 additions & 49 deletions judgels-client/src/components/Sidebar/Sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,68 @@

.bp5-tab-indicator {
border-radius: 0 !important;
}

.bp5-tab {
a {
width: 100%;
.bp5-light & {
background-color: $secondary-background-color !important;
border-left: 3px solid $primary-color;
}

.bp5-dark & {
background-color: $dark-secondary-background-color !important;
border-left: 3px solid $gray3;
}
}

.bp5-tab {
position: relative;
padding-left: 20px !important;
line-height: 50px;
height: 50px;
}

.bp5-tab[aria-selected='true'] {
font-weight: bold;
&:hover {
.bp5-light & {
background-color: $tertiary-background-color !important;
}

.bp5-dark & {
background-color: $dark-tertiary-background-color !important;
}
}

&[aria-selected='true'] {
font-weight: bold;

.bp5-light & {
color: $text-color;
}

.bp5-dark & {
color: inherit;
}
}

&[aria-selected='false'] {
.bp5-light & {
color: $primary-color;
}
}

a {
width: 100%;

.bp5-dark & {
color: $dark-text-color !important;
}
}
}
}

.card-sidebar__arrow {
float: right;

.bp5-light & {
color: $primary-color !important;
}
}

.card-sidebar__full {
Expand Down Expand Up @@ -72,45 +114,3 @@
}
}
}

.bp5-light .card-sidebar {
.card-sidebar__arrow {
color: $primary-color !important;
}

.bp5-tab-indicator {
background-color: $secondary-background-color !important;
border-left: 3px solid $primary-color;
}

.bp5-tab:hover {
background-color: $tertiary-background-color !important;
}

.bp5-tab[aria-selected='true'] {
color: $text-color;
}

.bp5-tab[aria-selected='false'] {
color: $primary-color;
}
}

.bp5-dark .card-sidebar {
.bp5-tab a {
color: $dark-text-color !important;
}

.bp5-tab[aria-selected='true'] {
color: inherit;
}

.bp5-tab-indicator {
background-color: $dark-secondary-background-color !important;
border-left: 3px solid $gray3;
}

.bp5-tab:hover {
background-color: $dark-tertiary-background-color !important;
}
}
8 changes: 4 additions & 4 deletions judgels-client/src/components/SourceCode/SourceCode.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
pre.source-code {
border-color: #cccccc;
background-color: #f5f5f5 !important;
}

.bp5-dark pre.source-code {
border-color: #202b33;
background-color: #293742 !important;
.bp5-dark & {
border-color: #202b33;
background-color: #293742 !important;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
.form-username,
.form-problem-alias {
float: right;

label {
float: left;
width: initial;
line-height: 30px;
margin-right: 5px;
}
.form-group-select {

.form-group__select {
float: left;
width: initial;
}
Expand Down
16 changes: 8 additions & 8 deletions judgels-client/src/components/UserWidget/UserWidget.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
line-height: 30px;
vertical-align: middle !important;

.bp5-light & {
background-color: #f4f5f6;
}

.bp5-dark & {
background-color: $dark-background-color;
}

svg {
vertical-align: middle !important;
}
Expand All @@ -18,14 +26,6 @@
color: inherit;
}

.bp5-light .widget-user__profile {
background-color: #f4f5f6;
}

.bp5-dark .widget-user__profile {
background-color: $dark-background-color;
}

.widget-user__avatar-wrapper {
height: 60px;
padding-top: 10px;
Expand Down
Loading

0 comments on commit 9c40925

Please sign in to comment.