Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tech/Refactor] Frontend/design system #1851

Merged
merged 8 commits into from
Oct 3, 2022
Prev Previous commit
Next Next commit
refactoring styles to use design system values
  • Loading branch information
BrettCleary committed Sep 29, 2022
commit 0e37a2df0ac694bd868263d1c91d19ed444437f9
180 changes: 2 additions & 178 deletions src/frontend/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,132 +75,6 @@ html,
color: var(--danger);
}

.button {
--line-height: 17px;
cursor: pointer;
padding: 0.75rem;
background: var(--primary);
color: #1a1b1c;
text-transform: uppercase;
font-family: var(--secondary-font-family);
font-style: normal;
font-weight: 500;
font-size: 14px;
line-height: var(--line-height);
color: #161616;
border: none;
max-height: 40px;
text-align: center;
transition: 500ms;
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
}

.button:disabled {
cursor: not-allowed;
}

.button.is-small {
min-width: 130px;
}

.button:hover {
background: #58545d;
}

.button.is-primary {
background: var(--primary);
}

.button.is-primary:hover {
background: var(--primary-hover);
}

.button.is-primary:disabled {
color: var(--text-secondary);
background: var(--background-secondary);
pointer-events: none;
}

.button.is-secondary {
background: var(--accent);
color: var(--text-tertiary);
}

.button:disabled.is-secondary,
.button:disabled:hover.is-secondary {
background-color: var(--background-secondary);
color: var(--text-secondary);
}

.button.is-tertiary {
background: var(--body-background);
color: var(--text-default);
}

.button.is-tools:hover,
.button.is-tools:focus-visible {
background-color: var(--stop-button);
}
.button.is-tools:hover .toolTitle,
.button.is-tools:focus-visible .toolTitle {
transition: 500ms;
color: var(--text-hover);
}

.button.is-secondary:hover {
background: var(--accent-overlay);
}

.button.is-empty {
background: transparent;
text-decoration: underline;
}

.button.is-danger {
background: var(--input-background);
color: var(--danger-hover);
}

.button.is-danger:hover,
.button.is-danger:focus-visible {
background: var(--danger);
color: var(--text-secondary);
}

.button.is-success {
background: var(--success);
}

.button.is-success:hover {
background: var(--success-hover);
}

.button.is-success:hover:disabled,
.button.is-success:disabled {
background: var(--background);
color: var(--text-default);
}

.button.outline {
background: transparent;
color: var(--accent);
border: 2px solid;
}

.button.outline:hover:disabled,
.button.outline:disabled {
background-color: var(--background-secondary);
color: var(--text-secondary);
border: none;
}

.button:hover.outline,
.button.outline.active {
background: transparent;
color: var(--accent-overlay) !important;
border: 2px solid;
}

.material-icons.is-primary {
/* I can't find any elements that use this, so idk what colour this should be */
color: var(--danger);
Expand All @@ -227,62 +101,12 @@ html,
color: var(--text-default);
}

.button.settings {
background: var(--text-secondary);
}

.button.settings:hover {
background: #7c7c7c;
}

.button.settings:disabled:hover,
.button.settings:disabled {
background: #7c7c7c;
}

.button.is-text {
border: none;
border-radius: 0;
background: transparent;
color: var(--text-default);
box-shadow: none;
text-transform: none;
min-width: fit-content;
font-family: var(--content-font-family);
font-size: 14px;
}

.button.is-text:hover {
color: var(--text-hover);
}

.button.is-link {
font-family: var(--secondary-font-family);
font-style: normal;
font-weight: normal;
font-size: 14px;
line-height: 17px;
color: var(--accent);
margin: 4px 0px;
cursor: pointer;
padding: 0.25rem;
}

.button.is-link:hover {
color: var(--text-hover);
}

.button.is-link[disabled] {
color: var(--icon-disabled);
cursor: wait;
}

.icons > * {
cursor: pointer;
}

.smallMessage {
font-size: 12px;
font-size: var(--text-xs);
width: 100%;
max-width: 513px;
white-space: break-spaces;
Expand All @@ -302,7 +126,7 @@ svg.disabled {

.react-contextmenu-item {
color: var(--text-default);
font-size: 14px;
font-size: var(--text-sm);
line-height: 26px;
font-family: var(--secondary-font-family);
cursor: pointer;
Expand Down
8 changes: 4 additions & 4 deletions src/frontend/components/UI/Anticheat/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
display: flex;
flex-direction: column;
max-width: 100%;
padding: 1rem;
padding: var(--space-md);
gap: 0.4rem;
margin: 1rem 0;
margin: var(--space-md) 0;
}

.anticheatInfo h4 {
margin: 0 0 1rem;
margin: 0 0 var(--space-md);
}

.anticheatInfo p {
margin: 0 0 1rem;
margin: 0 0 var(--space-md);
}

.anticheatInfo.Denied {
Expand Down
10 changes: 5 additions & 5 deletions src/frontend/components/UI/Dialog/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
.Dialog__headerTitle {
flex: 100% 1 1;
padding: var(--dialog-margin-vertical) 16px 0 var(--dialog-margin-horizontal);
font-size: 24px;
font-size: var(--text-xl);
margin: 0;
}

Expand All @@ -48,9 +48,9 @@

.Dialog__headerCloseButton {
border: none;
margin: -8px;
padding: 8px;
border-radius: 10px;
margin: calc(-1 * var(--space-xs));
padding: var(--space-xs);
border-radius: var(--space-xs);
background: none;
color: var(--text-default);
cursor: pointer;
Expand All @@ -71,7 +71,7 @@
}

.Dialog__headerCloseIcon {
font-size: 20px;
font-size: var(--text-lg);
}

.Dialog__content {
Expand Down
10 changes: 5 additions & 5 deletions src/frontend/components/UI/FormControl/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

.FormControl__select,
.FormControl__input {
font-size: 16px;
line-height: 19px;
font-size: var(--text-md);
line-height: var(--space-md);
}

.FormControl__input::placeholder {
Expand Down Expand Up @@ -70,7 +70,7 @@
box-sizing: border-box;
padding: 0 10px;
cursor: pointer;
font-size: 14px;
font-size: var(--text-sm);
text-transform: uppercase;
font-weight: 600;
color: var(--text-default);
Expand Down Expand Up @@ -101,7 +101,7 @@
}

.FormControl__segmentedFaIcon {
font-size: 20px;
font-size: var(--text-lg);
outline: none;
}

Expand All @@ -111,7 +111,7 @@

.FormControl__sideButton {
cursor: pointer;
font-size: 20px;
font-size: var(--text-lg);
position: absolute;
right: 0;
top: 50%;
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/components/UI/Header/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
grid-template-areas: 'filters search';
grid-gap: 8px;
align-items: start;
margin: 0 1rem 24px;
margin: 0 var(--space-md) var(--space-lg);
padding: 15px 0;
background: var(--gradient-body-background);
color: var(--text-secondary);
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/components/UI/InfoBox/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
cursor: default;
width: 100%;
padding: 12px 22px 12px 22px;
font-size: 16px;
font-size: var(--text-md);
line-height: 19px;
background-color: var(--input-background);
border-radius: 10px;
Expand Down
6 changes: 3 additions & 3 deletions src/frontend/components/UI/SelectField/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
background: var(--input-background);
font-family: var(--primary-font-family), 'Noto Color Emoji';
font-weight: normal;
font-size: 16px;
font-size: var(--text-md);
line-height: 19px;
color: var(--text-secondary);
text-indent: 22px;
Expand Down Expand Up @@ -69,15 +69,15 @@

.selectFieldWrapper.small label,
.selectFieldWrapper.smaller label {
margin: 0px 1rem;
margin: 0px var(--space-md);
}

.selectFieldWrapper select > option {
background: var(--navbar-background);
height: 40px;
color: var(--text-secondary);
text-indent: 22px;
font-size: 16px;
font-size: var(--text-md);
border-radius: 10px;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.currentDownload {
font-size: 13px;
font-size: var(--text-sm);
padding: 16px 0;
transition: 300ms;
margin-top: 12px;
}

.currentDownload > .gameTitle {
font-size: 16px;
font-size: var(--text-md);
transition: 600ms;
font-weight: 700;
}
Expand All @@ -21,7 +21,7 @@
font-family: var(--secondary-font-family);
font-style: italic;
font-weight: normal;
font-size: 14px;
font-size: var(--text-sm);
line-height: 12px;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.SidebarLinks {
grid-area: links;
padding-top: var(--sidebar-vertical-padding);
font-size: 18.5px;
font-size: var(--text-lg);
}

.Sidebar__item.SidebarLinks__subItem {
padding: 4px var(--sidebar-horizontal-padding) 4px 50px;
font-size: 14px;
font-size: var(--text-sm);
line-height: 20px;
white-space: break-spaces;
}
Expand Down
Loading