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.

widgets: Make the todo and poll widgets look consistent / similar.

N-Shar-mae2e39acbc441
diff --git a/static/images/checkbox-white.svg b/static/images/checkbox-white.svg
new file mode 100644
index 00000000000..fdb924e7f81
--- /dev/null
+++ b/static/images/checkbox-white.svg
@@ -0,0 +1 @@
+<svg id="SvgjsSvg1001" width="288" height="288" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs"><defs id="SvgjsDefs1002"></defs><g id="SvgjsG1008" transform="matrix(1,0,0,1,0,0)"><svg xmlns="http://www.w3.org/2000/svg" width="288" height="288" enable-background="new 0 0 96 96" viewBox="21 0 75 75"><path fill="#ffffff" d="M49.844,68.325c-1.416,0-2.748-0.554-3.75-1.557L27.523,48.191c-1.003-1.002-1.555-2.334-1.555-3.75 s0.552-2.749,1.555-3.75c1.001-1.001,2.333-1.552,3.75-1.552s2.75,0.551,3.753,1.553l14.019,14.017L82.14,5.504 c0.989-1.468,2.639-2.345,4.412-2.345c1.054,0,2.075,0.312,2.956,0.902c2.424,1.631,3.07,4.934,1.439,7.361L54.25,65.98 c-0.892,1.316-2.312,2.162-3.895,2.314C50.17,68.315,50.01,68.325,49.844,68.325z" class="color999 svgShape"></path></svg></g></svg>
\ No newline at end of file
diff --git a/static/styles/dark_theme.css b/static/styles/dark_theme.css
index 0120343fb27..b295bea7000 100644
--- a/static/styles/dark_theme.css
+++ b/static/styles/dark_theme.css
@@ -328,7 +328,15 @@
.new-style .button {
background-color: hsla(0, 0%, 0%, 0.2);
- &:not(.sea-green, .btn-danger, .btn-warning, .btn-link, .poll-vote) {
+ &:not(
+ .sea-green,
+ .btn-danger,
+ .btn-warning,
+ .btn-link,
+ .poll-vote,
+ button.poll-option,
+ button.add-task
+ ) {
border-color: hsla(0, 0%, 0%, 0.6);
color: inherit;
}
@@ -1374,6 +1382,31 @@
}
}
+ /* Widgets: Todo */
+ .todo-widget {
+ label.checkbox {
+ input[type="checkbox"] {
+ ~ span {
+ border-color: hsl(185, 40%, 45%);
+ opacity: 0.7;
+ }
+
+ &:hover ~ span {
+ background-color: hsl(185, 20%, 20%);
+ border-color: hsl(185, 40%, 35%);
+ }
+
+ &:checked ~ span {
+ background-color: hsl(185, 40%, 45%);
+ }
+
+ &:focus ~ span {
+ outline-color: hsla(0, 0%, 100%, 0);
+ }
+ }
+ }
+ }
+
/* Originally the icon inherits the color of label, but when the setting
is disabled, the color of the label is changed and thus the icon becomes
too light. So, we set the color explicitly to original color of label to
diff --git a/static/styles/widgets.css b/static/styles/widgets.css
index 80cbe2ff3a5..75505b7afcd 100644
--- a/static/styles/widgets.css
+++ b/static/styles/widgets.css
@@ -20,14 +20,52 @@
.todo-widget {
/* For the box-shadow to be visible on the left */
- input.add-task,
- input.add-desc {
- margin-left: 2px;
+ .add-task,
+ .add-desc {
+ font-size: 14px;
+ font-weight: 400;
+ margin-right: 4px;
}
- /* Arrange that a multi-line description line wraps properly. */
label.checkbox {
- display: flex;
+ display: flex; /* Arrange that a multi-line description line wraps properly. */
+ position: relative;
+ vertical-align: top;
+
+ input[type="checkbox"] {
+ ~ span {
+ height: 12px;
+ width: 12px;
+ border: 2px solid hsl(156, 28%, 70%);
+
+ border-radius: 4px;
+ filter: brightness(1);
+
+ cursor: pointer;
+ }
+
+ &:checked ~ span {
+ background-image: url("../images/checkbox-white.svg");
+ background-size: 75%;
+ background-position: 50% 50%;
+ background-repeat: no-repeat;
+ background-color: hsl(156, 41%, 40%);
+ border: 2px solid hsl(156, 41%, 40%);
+ }
+
+ &:disabled ~ span {
+ opacity: 0.5;
+ cursor: not-allowed;
+ }
+
+ &:hover ~ span {
+ border-color: hsl(156, 30%, 50%);
+ }
+
+ &:focus ~ span {
+ outline-color: hsla(0, 0%, 100%, 0);
+ }
+ }
}
}
@@ -55,25 +93,33 @@
}
.poll-widget {
+ .poll-option {
+ font-weight: 400;
+ font-size: 14px;
+ }
+
/* For the box-shadow to be visible on the left */
input.poll-option {
- margin-left: 2px;
+ margin-right: 4px;
}
- .poll-option {
+ span.poll-option {
font-weight: 600;
- font-size: 16px;
+ padding-top: 28px;
}
.poll-vote {
color: hsl(156, 41%, 40%);
border-color: hsl(156, 28%, 70%);
border-style: solid;
+ font-weight: 600;
border-radius: 3px;
margin-right: 4px;
padding-left: 2px; /* padding for Chromium browsers */
padding-right: 2px;
- min-width: 28px;
+ min-width: 25px;
+ height: 25px;
+ font-size: 13px;
background-color: hsl(0, 0%, 100%);
&:hover {
@@ -89,6 +135,7 @@
.poll-names {
color: hsl(0, 0%, 45%);
padding-left: 4px;
+ padding-top: 28px;
font-size: 14px;
}
}
@@ -108,15 +155,27 @@ button {
}
&.add-task,
- &.add-desc,
- &.poll-option,
- &.poll-question {
+ &.poll-option {
+ color: hsl(156, 41%, 40%);
+ border: 1px solid hsl(156, 28%, 70%);
+ width: 100px;
border-radius: 3px;
- border: 1px solid hsl(0, 0%, 80%);
background-color: hsl(0, 0%, 100%);
+ padding: 4px;
+ padding-left: 14px;
+ padding-right: 14px;
+ transition: all 0.2s ease;
- &:hover {
- border-color: hsl(0, 0%, 60%);
+ &:hover,
+ &:focus {
+ outline: 0;
+ border-color: hsl(156, 30%, 50%);
+ }
+
+ &:active {
+ border-color: hsl(156, 30%, 40%);
+ color: hsl(156, 44%, 43%);
+ background-color: hsl(154, 33%, 96%);
}
}
}