summaryrefslogtreecommitdiffstats
path: root/apps/web-shared/src/styles/components/btn-states.scss
blob: a2fc6c58d0df2c7025cd250058be13df038a7e5e (plain) (blame)
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
@use '../base' as *;

/* -------------------------------- 

File#: _1_btn-states
Title: Buttons states
Descr: Multi-state button elements
Usage: codyhouse.co/license

-------------------------------- */

.btn__content-a {
  display: inline-flex;
}

.btn__content-b {
  display: none;
}

.btn__content-a, .btn__content-b {
  align-items: center;
}

.btn--state-b {
  .btn__content-a {
    display: none;
  }

  .btn__content-b {
    display: inline-block; // fallback
    display: inline-flex;
  }
}

/* preserve button width when switching from state A to state B */
.btn--preserve-width {
  .btn__content-b {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
  }

  &.btn--state-b .btn__content-a {
    display: inline-block; // fallback
    display: inline-flex;
    visibility: hidden;
  }
}