Blame view

node_modules/bootstrap-vue/src/components/skeleton/_skeleton.scss 2.52 KB
4cd4fd28   郭伟龙   feat: 初始化项目
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
// Wrapper
.b-skeleton-wrapper {
  cursor: $b-skeleton-loading-cursor;
}

// Base
.b-skeleton {
  position: relative;
  overflow: hidden;
  background-color: $b-skeleton-background-color;
  cursor: $b-skeleton-loading-cursor;
  // https://gist.github.com/ayamflow/b602ab436ac9f05660d9c15190f4fd7b
  mask-image: radial-gradient(white, black);

  // Use `::before` since `::after` is used for the wave-animation
  &::before {
    content: "\00a0";
  }
}

// Text
.b-skeleton-text {
  height: $font-size-base;
  margin-bottom: $b-skeleton-text-spacing;

  @if $enable-rounded {
    border-radius: 0.25rem;
  }
}

// Button
.b-skeleton-button {
  width: $b-skeleton-btn-width;
  padding: $btn-padding-y $btn-padding-x;
  font-size: $btn-font-size;
  line-height: $btn-line-height;

  @if $enable-rounded {
    border-radius: $btn-border-radius;
  }
}

// Avatar
.b-skeleton-avatar {
  width: 2.5em;
  height: 2.5em;
  border-radius: 50%;
}

// Input
.b-skeleton-input {
  height: $input-height;
  padding: $input-padding-y $input-padding-x;
  line-height: $input-line-height;
  border: $input-border-color solid $input-border-width;

  @if $enable-rounded {
    border-radius: $input-border-radius;
  }
}

// Icon
.b-skeleton-icon-wrapper {
  svg {
    color: $b-skeleton-background-color;
  }
}

// Image
.b-skeleton-img {
  height: 100%;
  width: 100%;
}

// Wave animation
.b-skeleton-animate-wave {
  &::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;

    background: $b-skeleton-animate-wave-background;
    animation: b-skeleton-animate-wave $b-skeleton-animation-duration linear infinite;

    @media (prefers-reduced-motion: reduce) {
      background: none;
      animation: none;
    }
  }
}

@keyframes b-skeleton-animate-wave {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

// Fade animation
.b-skeleton-animate-fade {
  animation: b-skeleton-animate-fade ($b-skeleton-animation-duration * 0.5) ease-in-out alternate
    infinite;

  @media (prefers-reduced-motion: reduce) {
    animation: none;
  }
}

@keyframes b-skeleton-animate-fade {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0.4;
  }
}

// Throb animation
.b-skeleton-animate-throb {
  animation: b-skeleton-animate-throb ($b-skeleton-animation-duration * 0.5) ease-in alternate
    infinite;

  @media (prefers-reduced-motion: reduce) {
    animation: none;
  }
}

@keyframes b-skeleton-animate-throb {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(0.975);
  }
}