-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackground.js
45 lines (44 loc) · 995 Bytes
/
background.js
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
// Colored Backgrounds
export const backgroundColors = [
"default",
"primary",
"secondary",
"muted"
];
export const getBackgroundColorClass = (color) => {
if (backgroundColors.includes(color.toLowerCase())) {
return "uk-background-" + color.toLowerCase();
} else {
return "";
}
}
// Image Backgrounds
export const backgroundSizes = [
"cover",
"contain"
];
export const getBackgroundSizeClass = (size) => {
if (backgroundSizes.includes(size.toLowerCase())) {
return "uk-background-" + size;
} else {
return "";
}
}
export const backgroundPositions = [
"top-left",
"top-center",
"top-right",
"center-left",
"center-center",
"center-right",
"bottom-left",
"bottom-center",
"bottom-right"
];
export const getBackgroundPositionClass = (pos) => {
if (backgroundPositions.includes(pos.toLowerCase())) {
return "uk-background-" + pos;
} else {
return "";
}
}