Skip to content

Commit

Permalink
web/css: add shared class for primary color buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Nov 17, 2024
1 parent 9e795ed commit 4ee46c8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 25 deletions.
9 changes: 9 additions & 0 deletions web/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,15 @@ button, a.button, span.button {
color: var(--secondary-text-color);
background: none;
}

&.primary-color-button:not(:disabled) {
background-color: var(--primary-color);
color: var(--inverted-text-color);

&:hover, &:focus {
background-color: var(--primary-color-dark);
}
}
}

a {
Expand Down
6 changes: 0 additions & 6 deletions web/src/ui/login/LoginScreen.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,7 @@ main.matrix-login {
}

button {
background-color: var(--primary-color);
color: var(--inverted-text-color);
font-weight: bold;

&:hover, &:focus {
background-color: var(--primary-color-dark);
}
}

div.error {
Expand Down
4 changes: 2 additions & 2 deletions web/src/ui/login/LoginScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ export const LoginScreen = ({ client }: LoginScreenProps) => {
/>}
<div className="buttons">
{supportsSSO && <button
className="mx-login-button"
className="mx-login-button primary-color-button"
type={supportsPassword ? "button" : "submit"}
onClick={supportsPassword ? loginSSO : undefined}
>Login with SSO</button>}
{supportsPassword && <button
className="mx-login-button"
className="mx-login-button primary-color-button"
type="submit"
>Login{supportsSSO || beeperDomain ? " with password" : ""}</button>}
</div>
Expand Down
19 changes: 3 additions & 16 deletions web/src/ui/settings/SettingsView.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,11 @@ div.settings-view {

> button {
padding: .5rem 1rem;
font-weight: bold;

&.save {
background-color: var(--primary-color);
&.delete:hover, &.delete:focus {
background-color: var(--error-color);
color: var(--inverted-text-color);
font-weight: bold;

&:hover, &:focus {
background-color: var(--primary-color-dark);
}
}

&.delete {
font-weight: bold;

&:hover, &:focus {
background-color: var(--error-color);
color: var(--inverted-text-color);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion web/src/ui/settings/SettingsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const CustomCSSInput = ({ setPref, room }: { setPref: SetPrefFunc, room: RoomSta
<textarea value={text} onChange={onChangeText}/>
<div className="buttons">
<button className="delete" onClick={onDelete}>Delete</button>
<button className="save" onClick={onSave}>Save</button>
<button className="save primary-color-button" onClick={onSave}>Save</button>
</div>
</div>
}
Expand Down

0 comments on commit 4ee46c8

Please sign in to comment.