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: Reset CSS for textarea elements.

Sahil Batra365a83c1537b
diff --git a/web/styles/app_variables.css b/web/styles/app_variables.css
index 6f03436c06a..3b963f4b799 100644
--- a/web/styles/app_variables.css
+++ b/web/styles/app_variables.css
@@ -865,6 +865,22 @@
hsl(240deg 7% 93%),
hsl(240deg 7% 17%)
);
+ --background-color-textarea: light-dark(
+ hsl(0deg 0% 100%),
+ hsl(0deg 0% 0% / 20%)
+ );
+ --background-color-disabled-textarea: light-dark(
+ hsl(0deg 0% 93%),
+ hsl(0deg 0% 0% / 20%)
+ );
+ --border-color-textarea: light-dark(
+ hsl(0deg 0% 80%),
+ hsl(0deg 0% 0% / 60%)
+ );
+ --focus-border-color-textarea: light-dark(
+ hsl(206.5deg 80% 62% / 80%),
+ hsl(0deg 0% 0% / 90%)
+ );
--color-background-pill-container-without-placeholder: light-dark(
hsl(0deg 0% 100%),
hsl(0deg 0% 0% / 20%)
diff --git a/web/styles/compose.css b/web/styles/compose.css
index 566a4bf29e3..b103c43ab21 100644
--- a/web/styles/compose.css
+++ b/web/styles/compose.css
@@ -1078,6 +1078,10 @@ textarea.new_message_textarea {
scrollbar-color: hsl(0deg 0% 50%) transparent;
box-shadow: none;
+ font-size: 1em;
+ line-height: inherit;
+ font-family: "Source Sans 3 VF", sans-serif;
+
&:focus {
outline: 0;
}
diff --git a/web/styles/dark_theme.css b/web/styles/dark_theme.css
index 9e025caaf58..3ac9fb095ec 100644
--- a/web/styles/dark_theme.css
+++ b/web/styles/dark_theme.css
@@ -50,10 +50,8 @@
button:disabled:not(.action-button, .icon-button, .info-density-button),
option:disabled,
select:disabled,
- textarea:disabled,
input:disabled:not(.modal_text_input),
input:not([type="radio"], .modal_text_input):read-only,
- textarea:read-only,
#organization-permissions .dropdown-widget-button:disabled,
#organization-settings .dropdown-widget-button:disabled {
color: inherit;
@@ -65,7 +63,6 @@
opacity: 0.4;
}
- textarea,
select,
.user-status-content-wrapper,
.custom-time-input-value,
@@ -101,7 +98,7 @@
}
}
- textarea:focus,
+ textarea.schedule-reminder-note:focus,
#compose_recipient_box:focus {
border-color: hsl(0deg 0% 0% / 90%);
}
diff --git a/web/styles/message_row.css b/web/styles/message_row.css
index 868e8d299e7..f0e98366fb6 100644
--- a/web/styles/message_row.css
+++ b/web/styles/message_row.css
@@ -851,7 +851,7 @@
(which even has a background color of its own!). */
resize: none !important;
color: var(--color-text-default);
- background-color: hsl(0deg 0% 100%);
+ background-color: var(--background-color-textarea);
/* Flatten the bottom edge of the textarea to
merge with the flat top edge of the buttons row */
border-radius: 3px 3px 0 0;
@@ -864,6 +864,10 @@
box-shadow: none;
+ font-size: 1em;
+ line-height: inherit;
+ font-family: "Source Sans 3 VF", sans-serif;
+
&:focus {
outline: 0;
}
@@ -874,12 +878,6 @@
}
}
-/* The selector needs to be written this way to override the specificity
-of the base style defined for a read-only textarea in dark mode. */
-.message_edit_form .edit-controls textarea.message_edit_content:read-only {
- opacity: 1;
-}
-
.message-editing-animation {
display: inline-flex;
align-items: baseline;
diff --git a/web/styles/scheduled_messages.css b/web/styles/scheduled_messages.css
index 22fdebfecb7..2f7a83ddcf1 100644
--- a/web/styles/scheduled_messages.css
+++ b/web/styles/scheduled_messages.css
@@ -27,4 +27,10 @@
min-width: 10em;
padding: 3px;
min-height: 2em;
+
+ background-color: var(--background-color-textarea);
+
+ font-size: 1em;
+ line-height: inherit;
+ font-family: "Source Sans 3 VF", sans-serif;
}
diff --git a/web/styles/settings.css b/web/styles/settings.css
index 03979d9d3a2..bdfa58690af 100644
--- a/web/styles/settings.css
+++ b/web/styles/settings.css
@@ -1770,10 +1770,10 @@ label.preferences-radio-choice-label {
.settings-textarea,
.modal-textarea {
color: var(--color-text-default);
- background-color: hsl(0deg 0% 100%);
+ background-color: var(--background-color-textarea);
border-radius: 4px;
vertical-align: middle;
- border: var(--input-border-width) solid hsl(0deg 0% 80%);
+ border: var(--input-border-width) solid var(--border-color-textarea);
padding: var(--input-vertical-padding) var(--input-horizontal-padding);
box-shadow: inset 0 1px 1px hsl(0deg 0% 0% / 7.5%);
@@ -1781,8 +1781,12 @@ label.preferences-radio-choice-label {
border-color linear 0.2s,
box-shadow linear 0.2s;
+ font-size: 1em;
+ line-height: inherit;
+ font-family: "Source Sans 3 VF", sans-serif;
+
&:focus {
- border-color: hsl(206.5deg 80% 62% / 80%);
+ border-color: var(--focus-border-color-textarea);
outline: 0;
box-shadow:
@@ -1792,10 +1796,18 @@ label.preferences-radio-choice-label {
&:disabled {
cursor: not-allowed;
- background-color: hsl(0deg 0% 93%);
}
}
+.settings-textarea:disabled {
+ background-color: var(--background-color-disabled-textarea);
+ opacity: 0.5;
+}
+
+.modal-textarea:disabled {
+ background-color: var(--background-color-readonly-modal-input);
+}
+
@media (width < $lg_min) {
.settings-email-column {
display: none;
diff --git a/web/styles/zulip.css b/web/styles/zulip.css
index d9eb8d80945..3f8c1e97e82 100644
--- a/web/styles/zulip.css
+++ b/web/styles/zulip.css
@@ -132,8 +132,7 @@ button {
input,
button,
-select,
-textarea {
+select {
font-family: "Source Sans 3 VF", sans-serif;
/* Disable bootstrap size CSS; we want to use our default font size on
body for input elements. */
@@ -775,7 +774,6 @@ body.has-overlay-scrollbar {
position: relative;
}
-textarea,
input {
font-family: "Source Sans 3 VF", sans-serif;
}
@@ -788,7 +786,6 @@ button {
}
/* Override Bootstrap's fixed sizes for various elements */
-textarea,
label {
font-size: inherit;
line-height: inherit;