Skip to content

Commit

Permalink
Consolidate button.css into style.css (#1832)
Browse files Browse the repository at this point in the history
Resolves #1769

`style.css` already imports `button.css`, so each component doesn't need
to import `button.css` again.

This PR does the following:
* Drops the redundant `button.css` imports
* Moves the contents of `button.css` into `style.css`
* Drops a redundant `cursors.css` import

<a data-ca-tag
href="https://codeapprove.com/pr/tiny-pilot/tinypilot/1832"><img
src="https://codeapprove.com/external/github-tag-allbg.png" alt="Review
on CodeApprove" /></a>
  • Loading branch information
jdeanwallace authored Aug 5, 2024
1 parent 61511d3 commit c8b01b2
Show file tree
Hide file tree
Showing 15 changed files with 102 additions and 117 deletions.
103 changes: 0 additions & 103 deletions app/static/css/button.css

This file was deleted.

103 changes: 102 additions & 1 deletion app/static/css/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@import "../third-party/fonts/fonts.css";
@import "button.css";
@import "cursors.css";

:root {
Expand Down Expand Up @@ -126,6 +125,108 @@ input[type="password"].monospace {
height: 1.58rem;
}

button,
.btn {
display: inline-block;
padding: 0.4rem 1.25rem;
margin: 1rem;
text-decoration: none;
color: #ffffff;
font-size: 1rem;
font-family: inherit;
cursor: pointer;
text-align: center;
transition: background 250ms ease-in-out, transform 150ms ease;
-webkit-appearance: none;
-moz-appearance: none;
border-radius: var(--border-radius);
border: 1px solid var(--brand-metallic-medium);
background: var(--brand-metallic-light)
linear-gradient(0deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0) 60%);
}

button:hover,
.btn:hover,
button:focus,
.btn:focus {
background-color: var(--brand-metallic-bright);
}

button:focus,
.btn:focus {
outline: 1px solid #fff;
outline-offset: -4px;
}

button:active,
.btn:active {
transform: scale(0.99);
}

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

.btn-action {
background-color: var(--brand-blue);
border-color: var(--brand-blue-dark);
}

.btn-action:hover,
.btn-action:active,
.btn-action:focus {
background-color: var(--brand-blue-bright);
}

.btn-action:disabled {
background-color: var(--brand-blue-light);
}

.btn-success {
background-color: var(--brand-green);
border-color: var(--brand-green-dark);
}

.btn-success:hover,
.btn-success:active,
.btn-success:focus {
background-color: var(--brand-green-bright);
}

.btn-success:disabled {
background-color: var(--brand-green-light);
}

.btn-danger {
background-color: var(--brand-red);
border-color: var(--brand-red-dark);
}

.btn-danger:hover,
.btn-danger:active,
.btn-danger:focus {
background-color: var(--brand-red-bright);
}

.btn-danger:disabled {
background-color: var(--brand-red-light);
}

.btn-text {
text-decoration: underline;
cursor: pointer;
color: #555;
}

.btn-external-link {
background-image: url("/img/external-link-icon.svg");
background-repeat: no-repeat;
background-position: top 49% right 1.2em;
background-size: 0.75em;
padding-right: 2.5em;
}

.logs-output {
/* Note: don't forget to also add the monospace class when using this class */
padding: 0.25rem 0.5rem;
Expand Down
1 change: 0 additions & 1 deletion app/templates/custom-elements/about-dialog.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template id="about-dialog-template">
<style>
@import "css/style.css";
@import "css/button.css";

.content {
text-align: left;
Expand Down
1 change: 0 additions & 1 deletion app/templates/custom-elements/change-hostname-dialog.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template id="change-hostname-template">
<style>
@import "css/style.css";
@import "css/button.css";

#initializing,
#prompt,
Expand Down
1 change: 0 additions & 1 deletion app/templates/custom-elements/debug-dialog.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template id="debug-dialog-template">
<style>
@import "css/style.css";
@import "css/button.css";
@import "css/toggle.css";

#logs-loading,
Expand Down
1 change: 0 additions & 1 deletion app/templates/custom-elements/feature-pro-dialog.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template id="feature-pro-template">
<style>
@import "css/style.css";
@import "css/button.css";
</style>

<div id="feature-pro">
Expand Down
1 change: 0 additions & 1 deletion app/templates/custom-elements/menu-bar.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template id="menu-bar-template">
<style>
@import "css/style.css";
@import "css/cursors.css";

a {
color: white;
Expand Down
1 change: 0 additions & 1 deletion app/templates/custom-elements/network-status-dialog.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template id="network-status-dialog-template">
<style>
@import "css/style.css";
@import "css/button.css";

#initializing,
#display {
Expand Down
1 change: 0 additions & 1 deletion app/templates/custom-elements/share-logs-button.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template id="share-logs-button-template">
<style>
@import "css/style.css";
@import "css/button.css";

#get-url-button,
#get-url-button progress-spinner,
Expand Down
1 change: 0 additions & 1 deletion app/templates/custom-elements/shutdown-dialog.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template id="shutdown-dialog-template">
<style>
@import "css/style.css";
@import "css/button.css";

#prompt,
#restarting,
Expand Down
1 change: 0 additions & 1 deletion app/templates/custom-elements/update-dialog.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template id="update-dialog-template">
<style>
@import "css/style.css";
@import "css/button.css";

#checking,
#update-available,
Expand Down
1 change: 0 additions & 1 deletion app/templates/custom-elements/update-prompt-automatic.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template id="update-prompt-automatic">
<style>
@import "css/style.css";
@import "css/button.css";
</style>

<p>An update is available. Would you like to install the latest version?</p>
Expand Down
1 change: 0 additions & 1 deletion app/templates/custom-elements/video-settings-dialog.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template id="video-settings-template">
<style>
@import "css/style.css";
@import "css/button.css";
@import "css/icons.css";

#loading,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template id="video-settings-h264-stun-template">
<style>
@import "css/style.css";
@import "css/button.css";
@import "css/icons.css";

:host {
Expand Down
1 change: 0 additions & 1 deletion app/templates/custom-elements/wifi-dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<template id="wifi-template">
<style>
@import "css/style.css";
@import "css/button.css";

#initializing,
#prompt,
Expand Down

0 comments on commit c8b01b2

Please sign in to comment.