aboutsummaryrefslogtreecommitdiff
path: root/frontend/styles/form.sass
blob: ba9334e63c06d9a627d239cf740496bda0e1e242 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
@use 'colors'
@use 'sass:color'

$input-height: 2.5rem
$input-border-radius: 0.125rem
$input-border-color: colors.$gray-dark
$input-color-height: 0.7 * $input-height

.g-Label
    display: flex
    flex-direction: column
    margin-bottom: 1rem
    font-size: 0.9rem

    & > :first-child
        margin-top: 0.25rem

.g-Input
    display: flex
    height: $input-height
    border: 1px solid $input-border-color
    border-radius: $input-border-radius
    padding: 0 0.5rem
    font-size: inherit
    font-family: inherit

    &[type="color"]
        padding: 0
        border: none
        width: 100px
        height: $input-color-height

.g-Textarea
    padding: 0.5rem
    resize: vertical
    font-size: inherit
    font-family: inherit
    height: $input-height
    min-height: $input-height

.g-Select
    display: flex
    height: $input-height
    border: 1px solid $input-border-color
    border-radius: $input-border-radius
    padding: 0 0.5rem
    font-size: inherit

.g-Button
    display: flex
    align-items: center
    justify-content: center
    padding: 0.5rem
    height: $input-height
    cursor: pointer
    border: none
    border-radius: $input-border-radius
    color: black
    font-size: 1rem

    &:disabled
        background-color: colors.$gray
        cursor: default

    &--Primary
        background-color: colors.$green
        color: white
        &:not(:disabled):hover
            background-color: color.scale(colors.$green, $lightness: 10%)

    &--Danger
        background-color: colors.$red
        color: white
        &:not(:disabled):hover
            background-color: color.scale(colors.$red, $lightness: 10%)

    &--FullWidth
        width: 100%

.g-ColorLine
    display: flex
    gap: 2rem
    align-items: center

.g-ColorButtons
    display: flex
    gap: 1rem

.g-ColorButton
    border-radius: 50%
    width: $input-color-height
    height: $input-color-height
    border: none
    margin-top: 0.25rem
    cursor: pointer

.g-FormError
    color: colors.$red
    margin-bottom: 2rem
    text-align: center

.g-Form__SubmitParent
    position: relative

    .g-Button--Primary + .g-Form__SubmitSpinner
        background-color: colors.$green

    .g-Button--Danger + .g-Form__SubmitSpinner
        background-color: colors.$red

    & > .g-Form__SubmitSpinner
        position: absolute
        top: 0
        bottom: 0
        left: 0
        right: 0
        display: flex
        align-items: center
        justify-content: center

        svg
            height: $input-height * 0.6
            fill: white