@chassis-ui/docs 0.2.0 → 0.3.0
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 +16 -16
- package/index.ts +6 -1
- package/package.json +20 -8
- package/src/components/DocsSidebar.astro +63 -23
- package/src/components/FeatureCard.astro +3 -3
- package/src/components/TableOfContents.astro +8 -7
- package/src/components/ThemeToggler.astro +15 -36
- package/src/components/shortcodes/Blockquote.astro +1 -1
- package/src/components/shortcodes/CSSOnly.astro +6 -2
- package/src/components/shortcodes/Callout.astro +6 -2
- package/src/components/shortcodes/Code.astro +289 -0
- package/src/components/shortcodes/DeprecatedIn.astro +5 -2
- package/src/components/shortcodes/Example.astro +132 -0
- package/src/components/shortcodes/Icon.astro +57 -0
- package/src/components/shortcodes/InFigma.astro +7 -2
- package/src/components/shortcodes/JsDocs.astro +64 -0
- package/src/components/shortcodes/Placeholder.astro +28 -0
- package/src/components/shortcodes/ResizableExample.astro +126 -0
- package/src/components/shortcodes/ScssDocs.astro +108 -0
- package/src/components/shortcodes/ScssDocsSimple.astro +66 -0
- package/src/js/color-modes.js +3 -3
- package/src/js/example-mode.js +75 -0
- package/src/js/search.js +501 -39
- package/src/js/theme-color.js +1 -1
- package/src/layouts/DocsLayout.astro +11 -14
- package/src/layouts/RedirectLayout.astro +1 -0
- package/src/layouts/footer/Scripts.astro +14 -9
- package/src/layouts/head/Analytics.astro +12 -6
- package/src/layouts/head/Favicons.astro +0 -2
- package/src/layouts/head/Head.astro +2 -7
- package/src/layouts/head/Stylesheet.astro +18 -11
- package/src/layouts/header/Header.astro +2 -5
- package/src/layouts/header/Navigation.astro +31 -33
- package/src/layouts/header/SearchDialog.astro +74 -0
- package/src/layouts/header/SearchTrigger.astro +41 -0
- package/src/libs/highlight.ts +91 -0
- package/src/libs/icon.ts +75 -0
- package/src/libs/image.ts +12 -1
- package/src/libs/layout.ts +18 -0
- package/src/libs/markdown.ts +128 -0
- package/src/libs/placeholder.ts +250 -0
- package/src/libs/rehype.ts +0 -17
- package/src/libs/shortcodes.ts +129 -0
- package/src/libs/site.ts +95 -0
- package/src/libs/toc.ts +40 -6
- package/src/libs/utils.ts +34 -82
- package/src/libs/vite.ts +45 -0
- package/src/scss/_anchor.scss +20 -16
- package/src/scss/_callouts.scss +29 -28
- package/src/scss/_content.scss +72 -103
- package/src/scss/_footer.scss +18 -19
- package/src/scss/_layout.scss +56 -63
- package/src/scss/_navbar.scss +19 -123
- package/src/scss/_placeholder-img.scss +11 -7
- package/src/scss/_scrolling.scss +14 -12
- package/src/scss/_search.scss +418 -0
- package/src/scss/_shiki.scss +120 -0
- package/src/scss/_sidebar.scss +137 -132
- package/src/scss/_skippy.scss +6 -4
- package/src/scss/_snippets.scss +181 -0
- package/src/scss/_toc.scss +97 -93
- package/src/scss/_vars.scss +89 -0
- package/src/scss/main.scss +75 -80
- package/src/js/icon-loader.js +0 -229
- package/src/libs/chassis.ts +0 -38
- package/src/scss/_brand.scss +0 -59
- package/src/scss/_buttons.scss +0 -33
- package/src/scss/_clipboard-js.scss +0 -63
- package/src/scss/_code.scss +0 -116
- package/src/scss/_colors.scss +0 -140
- package/src/scss/_docsearch.scss +0 -212
- package/src/scss/_settings.scss +0 -29
- package/src/scss/_syntax.scss +0 -160
- package/src/scss/_variables.scss +0 -73
package/src/scss/_layout.scss
CHANGED
|
@@ -1,77 +1,70 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}
|
|
1
|
+
@use "./vars" as *;
|
|
2
|
+
@use "@chassis-ui/css/scss/mixins" as *;
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
@layer custom {
|
|
5
|
+
.cxd-gutter {
|
|
6
|
+
--cx-gutter-x: #{$cxd-gutter-x};
|
|
7
|
+
}
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
.cxd-layout {
|
|
10
|
+
@include media-breakpoint-up(large) {
|
|
11
|
+
display: grid;
|
|
12
|
+
grid-template-areas: "sidebar main";
|
|
13
|
+
grid-template-columns: 14rem auto;
|
|
14
|
+
gap: $cxd-gutter-x;
|
|
15
|
+
padding: 0 1rem;
|
|
16
|
+
margin: 0 auto;
|
|
17
|
+
}
|
|
17
18
|
}
|
|
18
|
-
}
|
|
19
19
|
|
|
20
|
-
.cxd-sidebar {
|
|
21
|
-
|
|
22
|
-
}
|
|
20
|
+
.cxd-sidebar {
|
|
21
|
+
grid-area: sidebar;
|
|
22
|
+
}
|
|
23
23
|
|
|
24
|
-
.cxd-intro {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
24
|
+
.cxd-intro {
|
|
25
|
+
grid-area: intro;
|
|
26
|
+
width: 100%;
|
|
27
|
+
max-width: 960px;
|
|
28
|
+
margin: 2rem auto 0;
|
|
29
|
+
}
|
|
30
30
|
|
|
31
|
-
.cxd-main {
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
.cxd-main {
|
|
32
|
+
grid-area: main;
|
|
33
|
+
order: 1;
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
@include media-breakpoint-down(large) {
|
|
36
|
+
margin-inline: auto;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@include media-breakpoint-up(medium) {
|
|
40
|
+
display: grid;
|
|
41
|
+
grid-template-areas:
|
|
42
|
+
"intro"
|
|
43
|
+
"toc"
|
|
44
|
+
"content";
|
|
45
|
+
grid-template-rows: auto auto 1fr;
|
|
46
|
+
gap: inherit;
|
|
47
|
+
}
|
|
39
48
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
gap: inherit;
|
|
49
|
+
@include media-breakpoint-up(large) {
|
|
50
|
+
grid-template-areas:
|
|
51
|
+
"intro toc"
|
|
52
|
+
"content toc";
|
|
53
|
+
grid-template-rows: auto 1fr;
|
|
54
|
+
grid-template-columns: auto 14rem;
|
|
55
|
+
}
|
|
48
56
|
}
|
|
49
57
|
|
|
50
|
-
|
|
51
|
-
grid-
|
|
52
|
-
"intro toc"
|
|
53
|
-
"content toc";
|
|
54
|
-
grid-template-rows: auto 1fr;
|
|
55
|
-
grid-template-columns: auto 14rem;
|
|
58
|
+
.cxd-toc {
|
|
59
|
+
grid-area: toc;
|
|
56
60
|
}
|
|
57
|
-
}
|
|
58
61
|
|
|
59
|
-
.cxd-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
.cxd-content {
|
|
63
|
+
grid-area: content;
|
|
64
|
+
justify-self: center;
|
|
65
|
+
width: 100%;
|
|
66
|
+
min-width: 1px; // Fix width when cxd-content contains a `<pre>` https://github.com/chassis-ui/css/issues/25410
|
|
67
|
+
max-width: 960px;
|
|
68
|
+
}
|
|
62
69
|
|
|
63
|
-
.cxd-content {
|
|
64
|
-
grid-area: content;
|
|
65
|
-
justify-self: center;
|
|
66
|
-
width: 100%;
|
|
67
|
-
min-width: 1px; // Fix width when cxd-content contains a `<pre>` https://github.com/chassis-ui/css/issues/25410
|
|
68
|
-
max-width: 960px;
|
|
69
70
|
}
|
|
70
|
-
|
|
71
|
-
// .cxd-content,
|
|
72
|
-
// .cxd-intro {
|
|
73
|
-
// width: 100%;
|
|
74
|
-
// max-width: 960px;
|
|
75
|
-
// margin-right: auto;
|
|
76
|
-
// margin-left: auto;
|
|
77
|
-
// }
|
package/src/scss/_navbar.scss
CHANGED
|
@@ -1,135 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
// box-shadow: 0 .5rem 1rem rgba($black, .15), inset 0 -1px 0 rgba($white, .15);
|
|
3
|
-
padding: 0;
|
|
4
|
-
// padding: .75rem 0;
|
|
5
|
-
background-color: to-opacity(var(--cx-bg-main), var(--cx-opacity-dim-main));
|
|
6
|
-
backdrop-filter: blur(24px);
|
|
7
|
-
border-bottom: var(--cx-border-width-medium) solid var(--cx-border-subtle);
|
|
1
|
+
@use "@chassis-ui/css/scss/mixins" as *;
|
|
8
2
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
// }
|
|
12
|
-
|
|
13
|
-
&::after {
|
|
14
|
-
position: absolute;
|
|
15
|
-
inset: 0;
|
|
16
|
-
z-index: -1;
|
|
17
|
-
display: block;
|
|
18
|
-
content: "";
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.cxd-navbar-toggle {
|
|
22
|
-
@include media-breakpoint-down(large) {
|
|
23
|
-
width: 4.25rem;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.navbar-toggler {
|
|
3
|
+
@layer custom {
|
|
4
|
+
.cxd-navbar {
|
|
28
5
|
padding: 0;
|
|
29
|
-
|
|
30
|
-
border: 0;
|
|
31
|
-
|
|
32
|
-
&:first-child {
|
|
33
|
-
margin-left: -.5rem;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.bi {
|
|
37
|
-
width: 1.5rem;
|
|
38
|
-
height: 1.5rem;
|
|
39
|
-
}
|
|
6
|
+
border-block-end: var(--cx-border-width-medium) solid var(--cx-border-subtle);
|
|
40
7
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.navbar-brand {
|
|
47
|
-
color: $white;
|
|
48
|
-
@include transition(transform .2s ease-in-out);
|
|
49
|
-
|
|
50
|
-
// &:hover {
|
|
51
|
-
// transform: rotate(-5deg) scale(1.1);
|
|
52
|
-
// }
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.navbar-toggler,
|
|
56
|
-
.nav-link {
|
|
57
|
-
--cx-caret-color: var(--cx-fg-color);
|
|
58
|
-
@include font-size(var(--cx-font-size-small));
|
|
59
|
-
font-weight: var(--cx-font-weight-strong);
|
|
60
|
-
// line-height: 1.75em;
|
|
61
|
-
text-transform: uppercase;
|
|
62
|
-
.icon {
|
|
63
|
-
--cx-icon-color: var(--cx-fg-color);
|
|
64
|
-
height: 24px;
|
|
65
|
-
vertical-align: -.275em;
|
|
8
|
+
> .container {
|
|
9
|
+
position: relative;
|
|
66
10
|
}
|
|
67
11
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
12
|
+
.navbar-toggler,
|
|
13
|
+
.nav-link {
|
|
14
|
+
--cx-caret-color: var(--cx-fg-color);
|
|
15
|
+
@include font-size(var(--cx-font-size-small));
|
|
16
|
+
font-weight: var(--cx-font-weight-strong);
|
|
17
|
+
text-transform: uppercase;
|
|
18
|
+
.icon {
|
|
19
|
+
--cx-icon-color: var(--cx-fg-color);
|
|
73
20
|
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
}
|
|
77
21
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
.#{large\:}offcanvas {
|
|
84
|
-
background-color: var(--cxd-subtle-bg);
|
|
85
|
-
border-left: 0;
|
|
86
|
-
|
|
87
|
-
@include media-breakpoint-down(large) {
|
|
88
|
-
height: 100vh;
|
|
89
|
-
box-shadow: var(--cx-box-shadow-large);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.dropdown-toggle {
|
|
94
|
-
&:focus:not(:focus-visible) {
|
|
95
|
-
outline: 0;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.dropdown-menu {
|
|
100
|
-
--cx-dropdown-min-width: 12rem;
|
|
101
|
-
--cx-dropdown-padding-x: .25rem;
|
|
102
|
-
--cx-dropdown-padding-y: .25rem;
|
|
103
|
-
@include rfs(.875rem, --cx-dropdown-font-size);
|
|
104
|
-
@include font-size(.875rem);
|
|
105
|
-
@include border-radius(.5rem);
|
|
106
|
-
position: absolute;
|
|
107
|
-
box-shadow: $dropdown-box-shadow;
|
|
108
|
-
|
|
109
|
-
li + li {
|
|
110
|
-
margin-top: .125rem;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.dropdown-item {
|
|
114
|
-
@include border-radius(.25rem);
|
|
115
|
-
|
|
116
|
-
&:active {
|
|
117
|
-
.icon {
|
|
118
|
-
color: inherit !important; // stylelint-disable-line declaration-no-important
|
|
22
|
+
@include media-breakpoint-up(large) {
|
|
23
|
+
padding: var(--cx-space-large) var(--cx-space-xsmall);
|
|
24
|
+
&.active {
|
|
25
|
+
padding-block-end: var(--cx-space-medium);
|
|
26
|
+
border-block-end: var(--cx-border-width-2xlarge) solid var(--cx-primary-cue-main);
|
|
119
27
|
}
|
|
120
28
|
}
|
|
121
29
|
}
|
|
122
|
-
|
|
123
|
-
.active {
|
|
124
|
-
font-weight: 600;
|
|
125
|
-
|
|
126
|
-
.icon {
|
|
127
|
-
display: block !important; // stylelint-disable-line declaration-no-important
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.dropdown-menu-end {
|
|
133
|
-
--cx-dropdown-min-width: 8rem;
|
|
134
30
|
}
|
|
135
31
|
}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
+
@use "@chassis-ui/css/scss/mixins" as *;
|
|
2
|
+
|
|
1
3
|
//
|
|
2
4
|
// Placeholder svg used in the docs.
|
|
3
5
|
//
|
|
4
6
|
|
|
5
7
|
// Remember to update `site/_layouts/examples.html` too if this changes!
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
@layer custom {
|
|
10
|
+
.cxd-placeholder-image {
|
|
11
|
+
@include font-size(1.125rem);
|
|
12
|
+
user-select: none;
|
|
13
|
+
text-anchor: middle;
|
|
14
|
+
}
|
|
12
15
|
|
|
13
|
-
.cxd-placeholder-image-large {
|
|
14
|
-
|
|
16
|
+
.cxd-placeholder-image-large {
|
|
17
|
+
@include font-size(3.5rem);
|
|
18
|
+
}
|
|
15
19
|
}
|
package/src/scss/_scrolling.scss
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
// When navigating with the keyboard, prevent focus from landing behind the sticky header
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
@layer custom {
|
|
4
|
+
main {
|
|
5
|
+
a,
|
|
6
|
+
button,
|
|
7
|
+
input,
|
|
8
|
+
select,
|
|
9
|
+
textarea,
|
|
10
|
+
h2,
|
|
11
|
+
h3,
|
|
12
|
+
h4,
|
|
13
|
+
[tabindex="0"] {
|
|
14
|
+
scroll-margin-block-start: 80px;
|
|
15
|
+
scroll-margin-block-end: 100px;
|
|
16
|
+
}
|
|
15
17
|
}
|
|
16
18
|
}
|