Define colors as sass variables⎄

This commit is contained in:
manubo
2019-09-25 15:53:54 +02:00
parent 994dfcba9a
commit 11073ef605
9 changed files with 37 additions and 21 deletions

View File

@@ -7,8 +7,8 @@ button.moco-bx-btn {
white-space: nowrap; white-space: nowrap;
color: white; color: white;
background-image: none; background-image: none;
background-color: #7dc332; background-color: $green;
border-color: #7dc332; border-color: $green;
border-radius: 0; border-radius: 0;
border-style: solid; border-style: solid;
box-shadow: none; box-shadow: none;
@@ -16,8 +16,8 @@ button.moco-bx-btn {
cursor: pointer; cursor: pointer;
&:hover:not(:disabled) { &:hover:not(:disabled) {
background-color: #639a28; background-color: $green-dark;
border-color: #639a28; border-color: $green-dark;
} }
&:disabled { &:disabled {

View File

@@ -1,3 +1,4 @@
@import "variables";
@import "button"; @import "button";
input { input {
@@ -15,7 +16,8 @@ input {
margin-bottom: 0.25rem; margin-bottom: 0.25rem;
} }
input, textarea { input,
textarea {
padding: 6px 12px; padding: 6px 12px;
background-color: white; background-color: white;
border-color: #cccccc; border-color: #cccccc;
@@ -31,13 +33,14 @@ input {
} }
&.has-error { &.has-error {
input, textarea { input,
border-color: #FB3A2F; textarea {
border-color: $red;
} }
} }
.form-error { .form-error {
color: #FB3A2F; color: $red;
} }
.input-group { .input-group {
@@ -71,8 +74,8 @@ input[name="hours"] {
outline: 0 !important; outline: 0 !important;
&:focus { &:focus {
border: 1px solid #38b5eb; border: 1px solid $blue;
box-shadow: 0 0 0 1px #38b5eb; box-shadow: 0 0 0 1px $blue;
} }
} }
@@ -84,8 +87,7 @@ textarea[name="description"] {
outline: 0 !important; outline: 0 !important;
&:focus { &:focus {
border: 1px solid #38b5eb; border: 1px solid $blue;
box-shadow: 0 0 0 1px #38b5eb; box-shadow: 0 0 0 1px $blue;
} }
} }

View File

@@ -3,3 +3,7 @@ $font-color: #191919;
$popup-width: 420px; $popup-width: 420px;
$popup-height: 463px; $popup-height: 463px;
$green: #7dc332;
$green-dark: #639a28;
$blue: #38b5eb;
$red: #fb3a2f;

View File

@@ -6,6 +6,10 @@
color: $font-color; color: $font-color;
pointer-events: all; pointer-events: all;
.text-red {
color: $red;
}
.moco-bx-bubble { .moco-bx-bubble {
box-sizing: content-box; box-sizing: content-box;
position: fixed; position: fixed;

View File

@@ -32,11 +32,11 @@
} }
.text-success { .text-success {
color: #7DC332; color: $green;
} }
.text-danger { .text-danger {
color: #FB3A2F; color: $red;
} }
} }
} }

View File

@@ -1,6 +1,6 @@
@import "variables";
@import "form"; @import "form";
@import "spinner"; @import "spinner";
@import "variables";
html { html {
overflow: hidden; overflow: hidden;
@@ -14,6 +14,10 @@ html {
#moco-bx-root { #moco-bx-root {
min-width: 516px; min-width: 516px;
.text-red {
color: $red;
}
.moco-bx-app-container { .moco-bx-app-container {
width: 324px; width: 324px;
padding: 3rem 6rem; padding: 3rem 6rem;
@@ -69,7 +73,7 @@ html {
&.moco-bx-calendar__day--filled { &.moco-bx-calendar__day--filled {
.moco-bx-calendar__hours { .moco-bx-calendar__hours {
background-color: #7dc332; background-color: $green;
} }
} }
@@ -82,7 +86,7 @@ html {
&.moco-bx-calendar__day--active { &.moco-bx-calendar__day--active {
.moco-bx-calendar__hours { .moco-bx-calendar__hours {
background-color: #38b5eb; background-color: $blue;
} }
} }
} }

View File

@@ -17,9 +17,10 @@ export default function TimerView({ timedActivity, onStopTimer }) {
<h3>{timedActivity.task_name}</h3> <h3>{timedActivity.task_name}</h3>
<br /> <br />
<Timer <Timer
className="text-red"
startedAt={parseISO(timedActivity.timer_started_at)} startedAt={parseISO(timedActivity.timer_started_at)}
offset={timedActivity.seconds} offset={timedActivity.seconds}
style={{ color: "red", fontSize: "60px", display: "inline-block" }} style={{ fontSize: "60px", display: "inline-block" }}
/> />
<button className="moco-bx-btn btn-stop-timer" onClick={handleStopTimer}> <button className="moco-bx-btn btn-stop-timer" onClick={handleStopTimer}>
Timer Stoppen Timer Stoppen

View File

@@ -16,9 +16,10 @@ const Bubble = ({ bookedSeconds, timedActivity }) => {
)} )}
{timedActivity && ( {timedActivity && (
<Timer <Timer
className="text-red"
startedAt={parseISO(timedActivity.timer_started_at)} startedAt={parseISO(timedActivity.timer_started_at)}
offset={timedActivity.seconds} offset={timedActivity.seconds}
style={{ color: "red", marginBottom: "3px", fontSize: "12px" }} style={{ marginBottom: "3px", fontSize: "12px" }}
/> />
)} )}
</div> </div>

View File

@@ -36,7 +36,7 @@ const customTheme = theme => ({
const customStyles = props => ({ const customStyles = props => ({
control: (base, _state) => ({ control: (base, _state) => ({
...base, ...base,
borderColor: props.hasError ? "#FB3A2F" : base.borderColor, borderColor: props.hasError ? "#fb3a2f" : base.borderColor,
}), }),
valueContainer: base => ({ valueContainer: base => ({
...base, ...base,