summaryrefslogtreecommitdiffstats
path: root/apps/web-shared/src/styles/components/chip.scss
blob: 1bb93db194a51dd8d0d86c777cc49c99025857ba (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
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
@use '../base' as *;

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

File#: _1_chips
Title: Chips
Descr: A list of compact pieces of information
Usage: codyhouse.co/license

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

.chip {
  /* reset - in case the class is applied to a <button> or an <a> */
  border: 0;
  color: inherit;
  line-height: 1;
  appearance: none;

  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);

  background-color: alpha(var(--color-contrast-higher), 0.1);
  padding: var(--space-xxxs) 0;
}

.chip--outline {
  background-color: transparent;
  box-shadow: inset 0 0 0 1px alpha(var(--color-contrast-higher), 0.25);
}

.chip--error {
  background-color: alpha(var(--color-error), 0.2);
  color: var(--color-contrast-higher);
}

.chip--success {
  background-color: alpha(var(--color-success), 0.2);
  color: var(--color-contrast-higher);
}

.chip--warning {
  background-color: alpha(var(--color-warning), 0.2);
  color: var(--color-contrast-higher);
}

.chip--interactive {
  cursor: pointer;

  &:hover {
    background-color: alpha(var(--color-contrast-higher), 0.2);
  }

  &:focus {
    outline: none;
    box-shadow: 0 0 0 3px alpha(var(--color-contrast-higher), 0.3);
  }

  &:focus:not(:focus-visible) {
    box-shadow: none;
  }
}

.chip__label {
  padding: 0 var(--space-xxs);
}

.chip__img {
  display: block;
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  object-fit: cover;
}

.chip__icon-wrapper {
  display: flex;
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  background-color: alpha(var(--color-contrast-higher), 0.95);
  color: var(--color-bg); /* icon color */

  .icon {
    display: block;
    margin: auto;
  }
}

.chip__btn {
  @include reset;
  display: flex;
  width: 1em;
  height: 1em;
  background-color: alpha(var(--color-contrast-higher), 0.2);
  border-radius: 50%;
  cursor: pointer;
  margin-right: 7px;

  .icon {
    display: block;
    margin: 0 auto;
  }

  &:hover {
    background-color: alpha(var(--color-contrast-higher), 0.3);
  }

  &:focus {
    outline: none;
    box-shadow: 0 0 0 2px alpha(var(--color-contrast-higher), 0.5);
  }

  &:focus:not(:focus-visible) {
    box-shadow: none;
  }
}