Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

css: Add variables for input padding and borders.

Sahil Batra3da5c2e5daf7
diff --git a/web/styles/app_components.css b/web/styles/app_components.css
index 78bd6ef468c..e318f2de8ab 100644
--- a/web/styles/app_components.css
+++ b/web/styles/app_components.css
@@ -1144,9 +1144,9 @@ div.overlay .flex.overlay-content > .overlay-container,
}
.filter_text_input {
- padding: 4px 6px;
+ padding: var(--input-vertical-padding) var(--input-horizontal-padding);
color: var(--color-text-default);
- border: 1px solid hsl(0deg 0% 80%);
+ border: var(--input-border-width) solid hsl(0deg 0% 80%);
transition:
border-color linear 0.2s,
box-shadow linear 0.2s;
diff --git a/web/styles/app_variables.css b/web/styles/app_variables.css
index 5c63295717d..6f03436c06a 100644
--- a/web/styles/app_variables.css
+++ b/web/styles/app_variables.css
@@ -708,6 +708,11 @@
--input-button-width: 1.5em; /* 24px at 16px/1em */
--input-button-ending-offset: 0.125em; /* 2px at 16px/1em */
+ /* Input padding and border variables */
+ --input-horizontal-padding: 6px;
+ --input-vertical-padding: 4px;
+ --input-border-width: 1px;
+
/* Colors used across the app */
--color-date: light-dark(hsl(0deg 0% 15% / 75%), hsl(0deg 0% 100% / 75%));
--color-background-private-message-header: light-dark(
diff --git a/web/styles/compose.css b/web/styles/compose.css
index db1bd59dffc..7dbd3319ff6 100644
--- a/web/styles/compose.css
+++ b/web/styles/compose.css
@@ -1964,8 +1964,11 @@ textarea.new_message_textarea {
#add-new-saved-snippet-modal,
#edit-saved-snippet-modal {
& .saved-snippet-title {
- /* subtract padding (6px each side) and border (1px each side) */
- width: calc(100% - 14px);
+ /* Subtract (2 * horizontal padding) + (2 * border width) */
+ width: calc(
+ 100% - 2 * var(--input-horizontal-padding) - 2 *
+ var(--input-border-width)
+ );
margin-bottom: 20px;
}
diff --git a/web/styles/modal.css b/web/styles/modal.css
index 31d61945144..5af36bc60be 100644
--- a/web/styles/modal.css
+++ b/web/styles/modal.css
@@ -468,18 +468,24 @@
.modal_password_input,
.modal_url_input,
.modal_text_input {
- padding: 4px 6px;
+ padding: var(--input-vertical-padding) var(--input-horizontal-padding);
color: var(--color-text-default);
border-radius: 4px;
- border: 1px solid hsl(0deg 0% 80%);
+ border: var(--input-border-width) solid hsl(0deg 0% 80%);
box-shadow: inset 0 1px 1px hsl(0deg 0% 0% / 7.5%);
transition:
border-color linear 0.2s,
box-shadow linear 0.2s;
margin-bottom: 10px;
- /* subtract padding (6px each side) and border (1px each side) */
- width: calc(var(--modal-input-width) - 14px);
- max-width: calc(100% - 14px);
+ /* Subtract (2 * horizontal padding) + (2 * border width) */
+ width: calc(
+ var(--modal-input-width) - 2 * var(--input-horizontal-padding) - 2 *
+ var(--input-border-width)
+ );
+ max-width: calc(
+ 100% - 2 * var(--input-horizontal-padding) - 2 *
+ var(--input-border-width)
+ );
&:focus {
border-color: hsl(206deg 80% 62% / 80%);
diff --git a/web/styles/settings.css b/web/styles/settings.css
index 8c84c89aa3f..03979d9d3a2 100644
--- a/web/styles/settings.css
+++ b/web/styles/settings.css
@@ -1535,9 +1535,9 @@ label.preferences-radio-choice-label {
.time-limit-custom-input,
.realm_jitsi_server_url_custom_input {
- padding: 4px 6px;
+ padding: var(--input-vertical-padding) var(--input-horizontal-padding);
color: var(--color-text-default);
- border: 1px solid hsl(0deg 0% 80%);
+ border: var(--input-border-width) solid hsl(0deg 0% 80%);
transition:
border-color linear 0.2s,
box-shadow linear 0.2s;
@@ -1623,10 +1623,16 @@ label.preferences-radio-choice-label {
}
.modal-textarea {
- /* Subtract (1px border and 6px padding) on each side */
+ /* Subtract (2 * horizontal padding) + (2 * border width) */
box-sizing: content-box;
- width: calc(var(--modal-input-width) - 14px);
- max-width: calc(100% - 14px);
+ width: calc(
+ var(--modal-input-width) - 2 * var(--input-horizontal-padding) - 2 *
+ var(--input-border-width)
+ );
+ max-width: calc(
+ 100% - 2 * var(--input-horizontal-padding) - 2 *
+ var(--input-border-width)
+ );
}
}
@@ -1767,8 +1773,8 @@ label.preferences-radio-choice-label {
background-color: hsl(0deg 0% 100%);
border-radius: 4px;
vertical-align: middle;
- border: 1px solid hsl(0deg 0% 80%);
- padding: 4px 6px;
+ border: var(--input-border-width) solid hsl(0deg 0% 80%);
+ padding: var(--input-vertical-padding) var(--input-horizontal-padding);
box-shadow: inset 0 1px 1px hsl(0deg 0% 0% / 7.5%);
transition:
@@ -2165,18 +2171,21 @@ label.preferences-radio-choice-label {
.settings_url_input,
.settings_text_input {
- padding: 4px 6px;
+ padding: var(--input-vertical-padding) var(--input-horizontal-padding);
color: var(--color-text-default);
border-radius: 4px;
- border: 1px solid hsl(0deg 0% 80%);
+ border: var(--input-border-width) solid hsl(0deg 0% 80%);
box-shadow: inset 0 1px 1px hsl(0deg 0% 0% / 7.5%);
transition:
border-color linear 0.2s,
box-shadow linear 0.2s;
margin-bottom: 10px;
- /* Subtract 2 * 6px (padding) + 2 * 1px (border) */
- width: calc(var(--modal-input-width) - 14px);
+ /* Subtract (2 * horizontal padding) + (2 * border width) */
+ width: calc(
+ var(--modal-input-width) - 2 * var(--input-horizontal-padding) - 2 *
+ var(--input-border-width)
+ );
&:focus {
border-color: hsl(206deg 80% 62% / 80%);
diff --git a/web/styles/widgets.css b/web/styles/widgets.css
index 2f94d791c8f..a6e1cf74788 100644
--- a/web/styles/widgets.css
+++ b/web/styles/widgets.css
@@ -267,7 +267,7 @@ input {
&.poll-question,
&.todo-task-list-title {
flex: 1 0 auto;
- padding: 4px 6px;
+ padding: var(--input-vertical-padding) var(--input-horizontal-padding);
}
}
diff --git a/web/styles/zulip.css b/web/styles/zulip.css
index cf82386163f..d9eb8d80945 100644
--- a/web/styles/zulip.css
+++ b/web/styles/zulip.css
@@ -1487,10 +1487,10 @@ div.topic_edit_spinner .loading_indicator_spinner {
width: 5ch;
margin-right: 15px;
- padding: 4px 6px;
+ padding: var(--input-vertical-padding) var(--input-horizontal-padding);
color: var(--color-text-default);
border-radius: 4px;
- border: 1px solid hsl(0deg 0% 80%);
+ border: var(--input-border-width) solid hsl(0deg 0% 80%);
box-shadow: inset 0 1px 1px hsl(0deg 0% 0% / 7.5%);
transition:
border-color linear 0.2s,