summaryrefslogtreecommitdiff
path: root/Pages/Component/Button.razor.css
blob: 5254030a57c184e28cfd194e0750ac4e1f699b8b (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
button {
    align-items:   center;
    background:    var(--col-pri);
    border-radius: 10px;
    border:        none;
    box-sizing:    border-box;
    color:         #fff;
    cursor:        pointer;
    display:       flex;
    height:        30px;
    margin:        10px 5px 0 5px;
    padding:       0 9px 0 9px;
    user-select:   none;
}

button > img, button > svg {
    height:       15px;
    margin-right: 5px;
    width:        15px;
}

@media (hover: none) and (pointer: coarse) {
    button > ::deep :not(:first-child) {
        display: none;
    }

    button > img, button > svg {
        height:       20px;
        margin-right: 0;
        padding:      8px;
        width:        20px;
    }

    /* disable hotkey underlines on mobile devices */
    ::deep button > ::deep u {
        text-decoration: none !important;
    }
}

@media(hover: hover) {
    button:hover:not(:active) {
        filter: brightness(1.2) saturate(0.5);
    }
}

button:active {
    background: #fff;
    color:      var(--col-pri);
}


button:disabled {
    color:      var(--col-button-disabled)    !important;
    background: var(--col-button-disabled-bg) !important;
}

button.error {
    animation-iteration-count: 3;
    animation-timing-function: linear;
    animation:                 button-error 0.2s;
}

button > svg.loading {
    animation:        loading-spin 1s linear infinite;
    transform-origin: center;
    will-change:      transform;
}

@keyframes button-error {
      0% { transform: translateX(0);    }
     33% { transform: translateX(-5px); }
     66% { transform: translateX(+5px); }
    100% { transform: translateX(0);    }
}

@keyframes loading-spin {
      0% { transform: rotate(0deg);   }
    100% { transform: rotate(360deg); }
}