tgui-core 1.7.0 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/components/Button.js +2 -2
- package/package.json +10 -9
- package/styles/base.scss +27 -0
- package/styles/colors.scss +88 -0
- package/styles/components/BlockQuote.scss +15 -0
- package/styles/components/Button.scss +171 -0
- package/styles/components/ColorBox.scss +7 -0
- package/styles/components/Dialog.scss +105 -0
- package/styles/components/Dimmer.scss +18 -0
- package/styles/components/Divider.scss +22 -0
- package/styles/components/Dropdown.scss +67 -0
- package/styles/components/Flex.scss +26 -0
- package/styles/components/Icon.scss +18 -0
- package/styles/components/ImageButton.scss +273 -0
- package/styles/components/Input.scss +63 -0
- package/styles/components/Knob.scss +126 -0
- package/styles/components/LabeledList.scss +44 -0
- package/styles/components/MenuBar.scss +71 -0
- package/styles/components/Modal.scss +9 -0
- package/styles/components/NoticeBox.scss +60 -0
- package/styles/components/NumberInput.scss +71 -0
- package/styles/components/ProgressBar.scss +58 -0
- package/styles/components/RoundGauge.scss +83 -0
- package/styles/components/Section.scss +156 -0
- package/styles/components/Slider.scss +49 -0
- package/styles/components/Stack.scss +59 -0
- package/styles/components/Table.scss +39 -0
- package/styles/components/Tabs.scss +139 -0
- package/styles/components/TextArea.scss +79 -0
- package/styles/components/Tooltip.scss +19 -0
- package/styles/functions.scss +74 -0
- package/styles/main.scss +33 -0
- package/styles/reset.scss +63 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
@use "sass:color";
|
|
2
|
+
@use "sass:map";
|
|
3
|
+
@use "sass:math";
|
|
4
|
+
@use "sass:meta";
|
|
5
|
+
|
|
6
|
+
// Type-casting
|
|
7
|
+
// --------------------------------------------------------
|
|
8
|
+
|
|
9
|
+
// Get a unit-less numeric value
|
|
10
|
+
@function num($value) {
|
|
11
|
+
@if meta.type-of($value) != number {
|
|
12
|
+
@error 'Could not convert `#{$value}` - must be `type-of number`';
|
|
13
|
+
@return null;
|
|
14
|
+
}
|
|
15
|
+
@if math.unit($value) == "%" {
|
|
16
|
+
@return math.div($value, 100%);
|
|
17
|
+
}
|
|
18
|
+
@return math.div($value, $value * 0 + 1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Color
|
|
22
|
+
// --------------------------------------------------------
|
|
23
|
+
|
|
24
|
+
// Increases perceptual color lightness.
|
|
25
|
+
@function lighten($color, $percent) {
|
|
26
|
+
$scaled: hsl(
|
|
27
|
+
color.channel($color, "hue", $space: hsl),
|
|
28
|
+
color.channel($color, "saturation", $space: hsl),
|
|
29
|
+
color.channel($color, "lightness", $space: hsl) * (1 + num($percent))
|
|
30
|
+
);
|
|
31
|
+
$mixed: color.mix(hsl(0, 0%, 100%), $color, 100% * num($percent));
|
|
32
|
+
@return color.mix($scaled, $mixed, 75%);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Returns the NTSC luminance of `$color` as a float (between 0 and 1).
|
|
36
|
+
// 1 is pure white, 0 is pure black.
|
|
37
|
+
@function luminance($color) {
|
|
38
|
+
$colors: (
|
|
39
|
+
"red": color.channel($color, "red", $space: rgb),
|
|
40
|
+
"green": color.channel($color, "green", $space: rgb),
|
|
41
|
+
"blue": color.channel($color, "blue", $space: rgb),
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
@each $name, $value in $colors {
|
|
45
|
+
$adjusted: 0;
|
|
46
|
+
$value: math.div($value, 255);
|
|
47
|
+
@if $value < 0.03928 {
|
|
48
|
+
$value: math.div($value, 12.92);
|
|
49
|
+
} @else {
|
|
50
|
+
$value: math.div($value + 0.055, 1.055);
|
|
51
|
+
$value: math.pow($value, 2.4);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
$colors: map.merge(
|
|
55
|
+
$colors,
|
|
56
|
+
(
|
|
57
|
+
$name: $value,
|
|
58
|
+
)
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@return (map.get($colors, "red") * 0.2126) +
|
|
63
|
+
(map.get($colors, "green") * 0.7152) + (map.get($colors, "blue") * 0.0722);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Blends an RGBA color with a static background color based on its
|
|
67
|
+
// alpha channel. Returns an RGB color, which is compatible with IE8.
|
|
68
|
+
@function fake-alpha($color-rgba, $color-background) {
|
|
69
|
+
@return color.mix(
|
|
70
|
+
color.change($color-rgba, $alpha: 1),
|
|
71
|
+
$color-background,
|
|
72
|
+
color.alpha($color-rgba) * 100%
|
|
73
|
+
);
|
|
74
|
+
}
|
package/styles/main.scss
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@use "sass:meta";
|
|
2
|
+
@use "base";
|
|
3
|
+
|
|
4
|
+
// Core styles
|
|
5
|
+
@include meta.load-css("./reset.scss");
|
|
6
|
+
|
|
7
|
+
// Components
|
|
8
|
+
@include meta.load-css("./components/BlockQuote.scss");
|
|
9
|
+
@include meta.load-css("./components/Button.scss");
|
|
10
|
+
@include meta.load-css("./components/ColorBox.scss");
|
|
11
|
+
@include meta.load-css("./components/Dialog.scss");
|
|
12
|
+
@include meta.load-css("./components/Dimmer.scss");
|
|
13
|
+
@include meta.load-css("./components/Divider.scss");
|
|
14
|
+
@include meta.load-css("./components/Dropdown.scss");
|
|
15
|
+
@include meta.load-css("./components/Flex.scss");
|
|
16
|
+
@include meta.load-css("./components/Icon.scss");
|
|
17
|
+
@include meta.load-css("./components/ImageButton.scss");
|
|
18
|
+
@include meta.load-css("./components/Input.scss");
|
|
19
|
+
@include meta.load-css("./components/Knob.scss");
|
|
20
|
+
@include meta.load-css("./components/LabeledList.scss");
|
|
21
|
+
@include meta.load-css("./components/MenuBar.scss");
|
|
22
|
+
@include meta.load-css("./components/Modal.scss");
|
|
23
|
+
@include meta.load-css("./components/NoticeBox.scss");
|
|
24
|
+
@include meta.load-css("./components/NumberInput.scss");
|
|
25
|
+
@include meta.load-css("./components/ProgressBar.scss");
|
|
26
|
+
@include meta.load-css("./components/RoundGauge.scss");
|
|
27
|
+
@include meta.load-css("./components/Section.scss");
|
|
28
|
+
@include meta.load-css("./components/Slider.scss");
|
|
29
|
+
@include meta.load-css("./components/Stack.scss");
|
|
30
|
+
@include meta.load-css("./components/Table.scss");
|
|
31
|
+
@include meta.load-css("./components/Tabs.scss");
|
|
32
|
+
@include meta.load-css("./components/TextArea.scss");
|
|
33
|
+
@include meta.load-css("./components/Tooltip.scss");
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
@use "base";
|
|
2
|
+
|
|
3
|
+
html,
|
|
4
|
+
body {
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
height: 100%;
|
|
7
|
+
margin: 0;
|
|
8
|
+
font-size: base.$font-size;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
html {
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
cursor: default; // Reset the cursor.
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
body {
|
|
17
|
+
overflow: auto;
|
|
18
|
+
font-family: Verdana, Geneva, sans-serif;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
*,
|
|
22
|
+
*:before,
|
|
23
|
+
*:after {
|
|
24
|
+
box-sizing: inherit;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
h1,
|
|
28
|
+
h2,
|
|
29
|
+
h3,
|
|
30
|
+
h4,
|
|
31
|
+
h5,
|
|
32
|
+
h6 {
|
|
33
|
+
display: block;
|
|
34
|
+
margin: 0;
|
|
35
|
+
padding: 6px 0;
|
|
36
|
+
padding: 0.5rem 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
h1 {
|
|
40
|
+
font-size: 18px;
|
|
41
|
+
font-size: 1.5rem;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
h2 {
|
|
45
|
+
font-size: 16px;
|
|
46
|
+
font-size: 1.333rem;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
h3 {
|
|
50
|
+
font-size: 14px;
|
|
51
|
+
font-size: 1.167rem;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
h4 {
|
|
55
|
+
font-size: 12px;
|
|
56
|
+
font-size: 1rem;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
td,
|
|
60
|
+
th {
|
|
61
|
+
vertical-align: baseline;
|
|
62
|
+
text-align: left;
|
|
63
|
+
}
|