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

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

File#: _1_alert
Title: Alert
Descr: Feedback message
Usage: codyhouse.co/license

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

.alert {
  background-color: alpha(var(--color-primary), 0.2);
  color: var(--color-contrast-higher);

  // hide element
  position: absolute;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
}

.alert__icon {
  color: var(--color-primary);
}

.alert__close-btn {
  display: inline-block;

  .icon {
    display: block;
  }

  &:hover {
    opacity: 0.7;
  }
}

// themes
.alert--success {
  background-color: alpha(var(--color-success), 0.2);

  .alert__icon {
    color: var(--color-success);
  }
}

.alert--error {
  background-color: alpha(var(--color-error), 0.2);

  .alert__icon {
    color: var(--color-error);
  }
}

.alert--warning {
  background-color: alpha(var(--color-warning), 0.2);

  .alert__icon {
    color: var(--color-warning);
  }
}

// toggle visibility
.alert--is-visible {
  position: static;
  clip: auto;
  clip-path: none;
}