Skip to content

Commit 52d0b8d

Browse files
committed
FEAT: Add initializer
1 parent ecaf284 commit 52d0b8d

File tree

3 files changed

+192
-2
lines changed

3 files changed

+192
-2
lines changed

packages/pycui/_index.scss

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@
2020
// SOFTWARE.
2121
///
2222

23+
@use 'init-base' as base;
24+
2325
@forward 'pyc-core';
2426

25-
@mixin init {
26-
//
27+
@mixin init($extend: (), $extended-tokens...) {
28+
@include base.init($extend, $extended-tokens...);
29+
@content;
2730
}

packages/pycui/_init-base.scss

+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
///
2+
// Copyright (c) 2022 Pycord Development
3+
//
4+
// Permission is hereby granted, free of charge, to any person obtaining a copy
5+
// of this software and associated documentation files (the "Software"), to deal
6+
// in the Software without restriction, including without limitation the rights
7+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
// copies of the Software, and to permit persons to whom the Software is
9+
// furnished to do so, subject to the following conditions:
10+
//
11+
// The above copyright notice and this permission notice shall be included in all
12+
// copies or substantial portions of the Software.
13+
//
14+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
// SOFTWARE.
21+
///
22+
23+
@use 'pyc-core';
24+
@use 'sass:map';
25+
26+
@use 'init-font-pack' as font-pack;
27+
28+
@mixin init($extend, $extended-tokens...) {
29+
:root {
30+
color-scheme: dark;
31+
@include pyc-core.token-config(
32+
map.deep-merge(pyc-core.$pyc-base-tokens, $extend),
33+
$primary: (
34+
'light': var(--pyc-theme-pyc-grey-light),
35+
'default': var(--pyc-theme-pyc-grey),
36+
'dark': var(--pyc-theme-pyc-grey-dark),
37+
'ink': var(--pyc-theme-pyc-grey-ink),
38+
),
39+
$accent: (
40+
'light': var(--pyc-theme-pyc-blurple-light),
41+
'default': var(--pyc-theme-pyc-blurple),
42+
'dark': var(--pyc-theme-pyc-blurple-dark),
43+
'ink': var(--pyc-theme-pyc-blurple-ink),
44+
),
45+
$radius: (
46+
'small': var(--pyc-theme-rounded-sm),
47+
'medium': var(--pyc-theme-rounded-md),
48+
'large': var(--pyc-theme-rounded-lg),
49+
'pill': var(--pyc-theme-rounded-pill),
50+
),
51+
$extended-tokens...
52+
);
53+
}
54+
55+
* {
56+
margin: 0;
57+
padding: 0;
58+
color: inherit;
59+
box-sizing: inherit;
60+
61+
&::before,
62+
&::after {
63+
margin: 0;
64+
padding: 0;
65+
color: inherit;
66+
box-sizing: inherit;
67+
}
68+
}
69+
70+
h1,
71+
h2,
72+
h3,
73+
h4,
74+
h5,
75+
h6,
76+
p,
77+
span,
78+
a {
79+
font-family: inherit;
80+
font-size: inherit;
81+
font-weight: pyc-core.token-get('fw-normal');
82+
line-height: pyc-core.token-get('lh-normal');
83+
}
84+
85+
li {
86+
list-style: none;
87+
}
88+
89+
@include font-pack.load();
90+
91+
a {
92+
text-decoration: none;
93+
color: pyc-core.token-get('pyc-blurple');
94+
95+
&:hover {
96+
color: pyc-core.token-get('pyc-blurple-light');
97+
}
98+
}
99+
100+
code {
101+
font-family: 'Fira Code', monospace;
102+
}
103+
104+
html {
105+
width: 100%;
106+
height: 100%;
107+
font-size: 100%;
108+
box-sizing: border-box;
109+
font-family: pyc-core.token-get('ff-global');
110+
font-weight: pyc-core.token-get('fw-normal');
111+
background-color: pyc-core.token-get('primary-dark');
112+
color: pyc-core.token-get('primary-ink');
113+
}
114+
}

packages/pycui/_init-font-pack.scss

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
///
2+
// Copyright (c) 2022 Pycord Development
3+
//
4+
// Permission is hereby granted, free of charge, to any person obtaining a copy
5+
// of this software and associated documentation files (the "Software"), to deal
6+
// in the Software without restriction, including without limitation the rights
7+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
// copies of the Software, and to permit persons to whom the Software is
9+
// furnished to do so, subject to the following conditions:
10+
//
11+
// The above copyright notice and this permission notice shall be included in all
12+
// copies or substantial portions of the Software.
13+
//
14+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
// SOFTWARE.
21+
///
22+
23+
@mixin load() {
24+
// vietnamese
25+
@font-face {
26+
font-family: 'Saira';
27+
font-style: normal;
28+
font-weight: 700;
29+
font-stretch: normal;
30+
font-display: swap;
31+
src: url(https://fonts.gstatic.com/s/saira/v8/memWYa2wxmKQyPMrZX79wwYZQMhsyuShhKMjjbU9uXuA773FksAxljYm.woff2) format('woff2');
32+
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
33+
}
34+
// latin-ext
35+
@font-face {
36+
font-family: 'Saira';
37+
font-style: normal;
38+
font-weight: 700;
39+
font-stretch: normal;
40+
font-display: swap;
41+
src: url(https://fonts.gstatic.com/s/saira/v8/memWYa2wxmKQyPMrZX79wwYZQMhsyuShhKMjjbU9uXuA773FksExljYm.woff2) format('woff2');
42+
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
43+
}
44+
// latin
45+
@font-face {
46+
font-family: 'Saira';
47+
font-style: normal;
48+
font-weight: 700;
49+
font-stretch: normal;
50+
font-display: swap;
51+
src: url(https://fonts.gstatic.com/s/saira/v8/memWYa2wxmKQyPMrZX79wwYZQMhsyuShhKMjjbU9uXuA773Fks8xlg.woff2) format('woff2');
52+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
53+
}
54+
55+
// latin
56+
@font-face {
57+
font-family: 'Outfit';
58+
font-style: normal;
59+
font-weight: 300;
60+
font-display: swap;
61+
src: url(https://fonts.gstatic.com/s/outfit/v4/QGYyz_MVcBeNP4NjuGObqx1XmO1I4W61O4a0Ew.woff2) format('woff2');
62+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
63+
}
64+
// latin
65+
@font-face {
66+
font-family: 'Outfit';
67+
font-style: normal;
68+
font-weight: 700;
69+
font-display: swap;
70+
src: url(https://fonts.gstatic.com/s/outfit/v4/QGYyz_MVcBeNP4NjuGObqx1XmO1I4deyO4a0Ew.woff2) format('woff2');
71+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
72+
}
73+
}

0 commit comments

Comments
 (0)