@chassis-ui/docs 0.1.10 → 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 +8 -8
- package/src/components/NavLink.astro +1 -1
- package/src/components/TableOfContents.astro +8 -7
- package/src/components/ThemeToggler.astro +16 -37
- package/src/components/shortcodes/Blockquote.astro +31 -0
- package/src/components/shortcodes/CSSOnly.astro +22 -0
- package/src/components/shortcodes/Callout.astro +6 -2
- package/src/components/shortcodes/Code.astro +289 -0
- package/src/components/shortcodes/DeprecatedIn.astro +18 -0
- package/src/components/shortcodes/Example.astro +132 -0
- package/src/components/shortcodes/Icon.astro +57 -0
- package/src/components/shortcodes/InFigma.astro +26 -0
- 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 +18 -21
- package/src/layouts/RedirectLayout.astro +1 -0
- package/src/layouts/SingleLayout.astro +3 -3
- package/src/layouts/footer/Footer.astro +5 -5
- package/src/layouts/footer/Scripts.astro +14 -7
- 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 +40 -42
- package/src/layouts/header/SearchDialog.astro +74 -0
- package/src/layouts/header/SearchTrigger.astro +41 -0
- package/src/layouts/header/Skippy.astro +1 -1
- 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 -61
- package/src/scss/_navbar.scss +19 -126
- 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 -81
- 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/_masthead.scss +0 -124
- package/src/scss/_settings.scss +0 -29
- package/src/scss/_syntax.scss +0 -160
- package/src/scss/_variables.scss +0 -78
package/src/js/icon-loader.js
DELETED
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Chassis Icons SVG Sprite Loader
|
|
3
|
-
*
|
|
4
|
-
* Efficiently loads and caches the chassis-icons.svg sprite using localStorage.
|
|
5
|
-
* This reduces page size by avoiding inline SVG and enables browser caching.
|
|
6
|
-
*
|
|
7
|
-
* Features:
|
|
8
|
-
* - localStorage caching with version control
|
|
9
|
-
* - Automatic fallback on cache miss or corruption
|
|
10
|
-
* - Network request deduplication
|
|
11
|
-
* - Small footprint and fast execution
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
;(function () {
|
|
15
|
-
'use strict'
|
|
16
|
-
|
|
17
|
-
// Configuration
|
|
18
|
-
const CACHE_KEY = 'chassis-icons-sprite'
|
|
19
|
-
const VERSION_KEY = 'chassis-icons-version'
|
|
20
|
-
const CURRENT_VERSION = '1.0.0' // Update when icons change
|
|
21
|
-
const SVG_URL = '/static/icons/chassis-icons.svg' // Icons SVG sprite path
|
|
22
|
-
|
|
23
|
-
// State management
|
|
24
|
-
let loadPromise = null
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Get SVG sprite from localStorage cache
|
|
28
|
-
* @returns {string|null} Cached SVG content or null if not found/invalid
|
|
29
|
-
*/
|
|
30
|
-
function getCachedSprite() {
|
|
31
|
-
try {
|
|
32
|
-
const cachedVersion = localStorage.getItem(VERSION_KEY)
|
|
33
|
-
const cachedSprite = localStorage.getItem(CACHE_KEY)
|
|
34
|
-
|
|
35
|
-
if (cachedVersion === CURRENT_VERSION && cachedSprite) {
|
|
36
|
-
return cachedSprite
|
|
37
|
-
}
|
|
38
|
-
} catch (error) {
|
|
39
|
-
console.warn('Failed to read icon cache:', error)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return null
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Store SVG sprite in localStorage cache
|
|
47
|
-
* @param {string} spriteContent - SVG content to cache
|
|
48
|
-
*/
|
|
49
|
-
function setCachedSprite(spriteContent) {
|
|
50
|
-
try {
|
|
51
|
-
localStorage.setItem(VERSION_KEY, CURRENT_VERSION)
|
|
52
|
-
localStorage.setItem(CACHE_KEY, spriteContent)
|
|
53
|
-
} catch (error) {
|
|
54
|
-
console.warn('Failed to cache icon sprite:', error)
|
|
55
|
-
// Handle localStorage quota exceeded or other errors
|
|
56
|
-
// Clear old cache and try again
|
|
57
|
-
try {
|
|
58
|
-
localStorage.removeItem(CACHE_KEY)
|
|
59
|
-
localStorage.removeItem(VERSION_KEY)
|
|
60
|
-
localStorage.setItem(VERSION_KEY, CURRENT_VERSION)
|
|
61
|
-
localStorage.setItem(CACHE_KEY, spriteContent)
|
|
62
|
-
} catch (retryError) {
|
|
63
|
-
console.warn('Failed to cache icon sprite after retry:', retryError)
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Fetch SVG sprite from network
|
|
70
|
-
* @returns {Promise<string>} Promise resolving to SVG content
|
|
71
|
-
*/
|
|
72
|
-
async function fetchSprite() {
|
|
73
|
-
const response = await fetch(SVG_URL)
|
|
74
|
-
|
|
75
|
-
if (!response.ok) {
|
|
76
|
-
throw new Error(`Failed to fetch icon sprite: ${response.status} ${response.statusText}`)
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const spriteContent = await response.text()
|
|
80
|
-
|
|
81
|
-
// Basic validation - ensure it's actually SVG content
|
|
82
|
-
if (!spriteContent.includes('<svg') || !spriteContent.includes('</svg>')) {
|
|
83
|
-
throw new Error('Invalid SVG content received')
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return spriteContent
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Inject SVG sprite into the DOM
|
|
91
|
-
* @param {string} spriteContent - SVG content to inject
|
|
92
|
-
*/
|
|
93
|
-
function injectSprite(spriteContent) {
|
|
94
|
-
// Remove any existing sprite container
|
|
95
|
-
const existingContainer = document.getElementById('chassis-icons-sprite')
|
|
96
|
-
if (existingContainer) {
|
|
97
|
-
existingContainer.remove()
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Create hidden container for the sprite
|
|
101
|
-
const container = document.createElement('div')
|
|
102
|
-
container.id = 'chassis-icons-sprite'
|
|
103
|
-
container.style.display = 'none'
|
|
104
|
-
container.setAttribute('aria-hidden', 'true')
|
|
105
|
-
|
|
106
|
-
// Use DOMParser to safely parse SVG content instead of innerHTML
|
|
107
|
-
const parsed = new DOMParser().parseFromString(spriteContent, 'image/svg+xml')
|
|
108
|
-
const svgEl = parsed.querySelector('svg')
|
|
109
|
-
if (svgEl) {
|
|
110
|
-
container.appendChild(svgEl)
|
|
111
|
-
} else {
|
|
112
|
-
// Fallback: should not happen given fetchSprite validation
|
|
113
|
-
container.innerHTML = spriteContent
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// Insert at the end of body
|
|
117
|
-
document.body.appendChild(container)
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Load and inject the icon sprite
|
|
122
|
-
* @returns {Promise<void>} Promise that resolves when sprite is loaded
|
|
123
|
-
*/
|
|
124
|
-
function loadIconSprite() {
|
|
125
|
-
// Return existing promise if already loading
|
|
126
|
-
if (loadPromise) {
|
|
127
|
-
return loadPromise
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// Check cache first
|
|
131
|
-
const cachedSprite = getCachedSprite()
|
|
132
|
-
if (cachedSprite) {
|
|
133
|
-
injectSprite(cachedSprite)
|
|
134
|
-
return Promise.resolve()
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// Fetch from network
|
|
138
|
-
loadPromise = fetchSprite()
|
|
139
|
-
.then((spriteContent) => {
|
|
140
|
-
// Cache the content
|
|
141
|
-
setCachedSprite(spriteContent)
|
|
142
|
-
|
|
143
|
-
// Inject into DOM
|
|
144
|
-
injectSprite(spriteContent)
|
|
145
|
-
})
|
|
146
|
-
.catch((error) => {
|
|
147
|
-
console.error('Failed to load icon sprite:', error)
|
|
148
|
-
// Don't throw - let the page continue to work without icons
|
|
149
|
-
})
|
|
150
|
-
.finally(() => {
|
|
151
|
-
loadPromise = null
|
|
152
|
-
})
|
|
153
|
-
|
|
154
|
-
return loadPromise
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Initialize icon loading
|
|
159
|
-
* Runs immediately if DOM is ready, or waits for DOMContentLoaded
|
|
160
|
-
*/
|
|
161
|
-
function init() {
|
|
162
|
-
if (document.readyState === 'loading') {
|
|
163
|
-
document.addEventListener('DOMContentLoaded', loadIconSprite)
|
|
164
|
-
} else {
|
|
165
|
-
loadIconSprite()
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// Public API for manual cache management
|
|
170
|
-
window.ChassisIcons = {
|
|
171
|
-
/**
|
|
172
|
-
* Manually reload the icon sprite (bypasses cache)
|
|
173
|
-
* @returns {Promise<void>}
|
|
174
|
-
*/
|
|
175
|
-
reload: async function () {
|
|
176
|
-
try {
|
|
177
|
-
// Clear cache
|
|
178
|
-
localStorage.removeItem(CACHE_KEY)
|
|
179
|
-
localStorage.removeItem(VERSION_KEY)
|
|
180
|
-
|
|
181
|
-
// Force reload
|
|
182
|
-
loadPromise = null
|
|
183
|
-
await loadIconSprite()
|
|
184
|
-
} catch (error) {
|
|
185
|
-
console.error('Failed to reload icon sprite:', error)
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Clear the icon cache
|
|
191
|
-
*/
|
|
192
|
-
clearCache: function () {
|
|
193
|
-
try {
|
|
194
|
-
localStorage.removeItem(CACHE_KEY)
|
|
195
|
-
localStorage.removeItem(VERSION_KEY)
|
|
196
|
-
} catch (error) {
|
|
197
|
-
console.warn('Failed to clear icon cache:', error)
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Get cache information
|
|
203
|
-
* @returns {object} Cache status and size info
|
|
204
|
-
*/
|
|
205
|
-
getCacheInfo: function () {
|
|
206
|
-
try {
|
|
207
|
-
const version = localStorage.getItem(VERSION_KEY)
|
|
208
|
-
const sprite = localStorage.getItem(CACHE_KEY)
|
|
209
|
-
return {
|
|
210
|
-
version: version,
|
|
211
|
-
cached: !!sprite,
|
|
212
|
-
size: sprite ? sprite.length : 0,
|
|
213
|
-
currentVersion: CURRENT_VERSION
|
|
214
|
-
}
|
|
215
|
-
} catch (error) {
|
|
216
|
-
return {
|
|
217
|
-
version: null,
|
|
218
|
-
cached: false,
|
|
219
|
-
size: 0,
|
|
220
|
-
currentVersion: CURRENT_VERSION,
|
|
221
|
-
error: error.message
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
// Initialize
|
|
228
|
-
init()
|
|
229
|
-
})()
|
package/src/libs/chassis.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes } from 'astro/types'
|
|
2
|
-
|
|
3
|
-
export function getChassisCssProps(direction: 'rtl' | undefined) {
|
|
4
|
-
let cxCssLinkHref = '/static/css/chassis'
|
|
5
|
-
|
|
6
|
-
if (direction === 'rtl') {
|
|
7
|
-
cxCssLinkHref = `${cxCssLinkHref}.rtl`
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
if (import.meta.env.PROD) {
|
|
11
|
-
cxCssLinkHref = `${cxCssLinkHref}.min`
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
cxCssLinkHref = `${cxCssLinkHref}.css`
|
|
15
|
-
|
|
16
|
-
const cxCssLinkProps: HTMLAttributes<'link'> = {
|
|
17
|
-
href: cxCssLinkHref,
|
|
18
|
-
rel: 'stylesheet'
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return cxCssLinkProps
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function getChassisJsProps() {
|
|
25
|
-
let cxJsScriptSrc = '/static/js/chassis.bundle'
|
|
26
|
-
|
|
27
|
-
if (import.meta.env.PROD) {
|
|
28
|
-
cxJsScriptSrc = `${cxJsScriptSrc}.min`
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
cxJsScriptSrc = `${cxJsScriptSrc}.js`
|
|
32
|
-
|
|
33
|
-
const cxJsLinkProps: HTMLAttributes<'script'> = {
|
|
34
|
-
src: cxJsScriptSrc
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return cxJsLinkProps
|
|
38
|
-
}
|
package/src/scss/_brand.scss
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Brand guidelines
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
// Logo series wrapper
|
|
6
|
-
.cxd-brand-logos {
|
|
7
|
-
color: $cxd-subtle;
|
|
8
|
-
|
|
9
|
-
.inverse {
|
|
10
|
-
color: $white;
|
|
11
|
-
background-color: $cxd-subtle;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// Individual items
|
|
16
|
-
.cxd-brand-item {
|
|
17
|
-
+ .cxd-brand-item {
|
|
18
|
-
border-top: 1px solid var(--cx-border-color);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
@include media-breakpoint-up(medium) {
|
|
22
|
-
+ .cxd-brand-item {
|
|
23
|
-
border-top: 0;
|
|
24
|
-
border-left: 1px solid var(--cx-border-color);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
//
|
|
30
|
-
// Color swatches
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
.color-swatches {
|
|
34
|
-
margin: 0 -5px;
|
|
35
|
-
|
|
36
|
-
// Docs colors
|
|
37
|
-
.cxd-main {
|
|
38
|
-
background-color: $cxd-main;
|
|
39
|
-
}
|
|
40
|
-
.cxd-main-light {
|
|
41
|
-
background-color: $cxd-main-light;
|
|
42
|
-
}
|
|
43
|
-
.cxd-main-lighter {
|
|
44
|
-
background-color: #e5e1ea;
|
|
45
|
-
}
|
|
46
|
-
.cxd-gray {
|
|
47
|
-
background-color: #f9f9f9;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.color-swatch {
|
|
52
|
-
width: 4rem;
|
|
53
|
-
height: 4rem;
|
|
54
|
-
|
|
55
|
-
@include media-breakpoint-up(medium) {
|
|
56
|
-
width: 6rem;
|
|
57
|
-
height: 6rem;
|
|
58
|
-
}
|
|
59
|
-
}
|
package/src/scss/_buttons.scss
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// Buttons
|
|
2
|
-
//
|
|
3
|
-
// Custom buttons for the docs.
|
|
4
|
-
|
|
5
|
-
// scss-docs-start cxd-button
|
|
6
|
-
.cxd-button {
|
|
7
|
-
|
|
8
|
-
--#{$prefix}padding-y: var(--#{$prefix}space-3xsmall);
|
|
9
|
-
--#{$prefix}padding-x: var(--#{$prefix}space-large);
|
|
10
|
-
--#{$prefix}gap: var(--#{$prefix}space-small);
|
|
11
|
-
--#{$prefix}font-family: var(--#{$prefix}font-family-text);
|
|
12
|
-
--#{$prefix}font-size: var(--#{$prefix}font-size-large);
|
|
13
|
-
--#{$prefix}font-weight: var(--#{$prefix}font-weight-mass);
|
|
14
|
-
// --#{$prefix}line-height: var(--#{$prefix}line-height-large);
|
|
15
|
-
--#{$prefix}icon-size: var(--#{$prefix}icon-large);
|
|
16
|
-
|
|
17
|
-
display: inline-flex;
|
|
18
|
-
gap: var(--#{$prefix}gap);
|
|
19
|
-
align-items: center;
|
|
20
|
-
text-decoration: if($link-decoration == none, null, none);
|
|
21
|
-
|
|
22
|
-
@extend %button, %solid-button, %component;
|
|
23
|
-
// @include exclude-strokes(button);
|
|
24
|
-
|
|
25
|
-
&.large {
|
|
26
|
-
--#{$prefix}font-size: var(--#{$prefix}font-size-xlarge);
|
|
27
|
-
--#{$prefix}line-height: var(--#{$prefix}line-height-xlarge);
|
|
28
|
-
--#{$prefix}font-weight: var(--#{$prefix}font-weight-strong);
|
|
29
|
-
--#{$prefix}icon-size: var(--#{$prefix}icon-xlarge);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
// scss-docs-end cxd-button
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// clipboard.js
|
|
2
|
-
//
|
|
3
|
-
// JS-based `Copy` buttons for code snippets.
|
|
4
|
-
|
|
5
|
-
.cxd-mode {
|
|
6
|
-
position: absolute;
|
|
7
|
-
top: 0;
|
|
8
|
-
right: 0;
|
|
9
|
-
z-index: 3;
|
|
10
|
-
margin-top: .75rem;
|
|
11
|
-
margin-right: .75rem;
|
|
12
|
-
.button-mode {
|
|
13
|
-
background-color: var(--cx-bg-idle);
|
|
14
|
-
border: var(--cx-border-width) solid var(--cx-border-subtle);
|
|
15
|
-
}
|
|
16
|
-
&:not(.cxd-example:hover &) {
|
|
17
|
-
display: none;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
.cxd-clipboard,
|
|
21
|
-
.cxd-edit {
|
|
22
|
-
position: relative;
|
|
23
|
-
display: none;
|
|
24
|
-
float: right;
|
|
25
|
-
|
|
26
|
-
+ .highlight {
|
|
27
|
-
margin-top: 0;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@include media-breakpoint-up(medium) {
|
|
31
|
-
display: block;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.button-mode,
|
|
36
|
-
.button-clipboard,
|
|
37
|
-
.button-edit {
|
|
38
|
-
--cx-icon-color: var(--cx-fg-subtle);
|
|
39
|
-
--cx-icon-size: var(--cx-icon-small);
|
|
40
|
-
display: block;
|
|
41
|
-
padding: .5em .25em;
|
|
42
|
-
line-height: 1;
|
|
43
|
-
background-color: var(--cxd-pre-bg);
|
|
44
|
-
border: 0;
|
|
45
|
-
@include border-radius(.25rem);
|
|
46
|
-
|
|
47
|
-
&:hover {
|
|
48
|
-
color: var(--cx-hover-color);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&:focus {
|
|
52
|
-
z-index: 3;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.button-mode,
|
|
57
|
-
.button-clipboard {
|
|
58
|
-
position: relative;
|
|
59
|
-
z-index: 2;
|
|
60
|
-
margin-top: .75rem;
|
|
61
|
-
margin-right: .75rem;
|
|
62
|
-
}
|
|
63
|
-
|
package/src/scss/_code.scss
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Docs examples
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
.cxd-code-snippet {
|
|
6
|
-
//background-color: var(--cx-bg-evident);
|
|
7
|
-
margin: 0 ($cxd-gutter-x * -.5) 1rem;
|
|
8
|
-
border: solid var(--cx-border-subtle);
|
|
9
|
-
border-width: 1px 0;
|
|
10
|
-
|
|
11
|
-
@include media-breakpoint-up(medium) {
|
|
12
|
-
margin-right: 0;
|
|
13
|
-
margin-left: 0;
|
|
14
|
-
border-width: 1px;
|
|
15
|
-
@include border-radius(var(--cx-border-radius));
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.cxd-example {
|
|
20
|
-
|
|
21
|
-
// background-color: var(--cx-bg-main);
|
|
22
|
-
--cxd-example-padding: 1rem;
|
|
23
|
-
|
|
24
|
-
position: relative;
|
|
25
|
-
padding: var(--cxd-example-padding);
|
|
26
|
-
margin: 0 ($cxd-gutter-x * -.5) 1rem;
|
|
27
|
-
border: solid var(--cx-border-subtle);
|
|
28
|
-
border-width: 1px 0;
|
|
29
|
-
@include clearfix();
|
|
30
|
-
|
|
31
|
-
@include media-breakpoint-up(medium) {
|
|
32
|
-
--cxd-example-padding: 1.5rem;
|
|
33
|
-
|
|
34
|
-
margin-right: 0;
|
|
35
|
-
margin-left: 0;
|
|
36
|
-
border-width: 1px;
|
|
37
|
-
@include border-radius(var(--cx-border-radius));
|
|
38
|
-
&:has(~ .highlight-toolbar) {
|
|
39
|
-
@include border-bottom-radius(0);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
+ p {
|
|
44
|
-
margin-top: 2rem;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
//
|
|
49
|
-
// Code snippets
|
|
50
|
-
//
|
|
51
|
-
|
|
52
|
-
.highlight {
|
|
53
|
-
position: relative;
|
|
54
|
-
padding: 1.25rem ($cxd-gutter-x * .5);
|
|
55
|
-
background-color: var(--cxd-pre-bg, var(--cx-bg-even));
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
@include media-breakpoint-up(medium) {
|
|
59
|
-
padding: 1.25rem;
|
|
60
|
-
@include border-radius(calc(var(--cx-border-radius) - 1px));
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@include media-breakpoint-up(large) {
|
|
64
|
-
pre {
|
|
65
|
-
margin-right: 1.875rem;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
pre {
|
|
70
|
-
// padding: .25rem 0 .875rem;
|
|
71
|
-
// margin-top: .8125rem;
|
|
72
|
-
margin-bottom: 0;
|
|
73
|
-
overflow: overlay;
|
|
74
|
-
@include font-size(var(--cx-font-size-code-small));
|
|
75
|
-
line-height: var(--cx-line-height-code-small);
|
|
76
|
-
white-space: pre;
|
|
77
|
-
background-color: transparent;
|
|
78
|
-
border: 0;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
pre code {
|
|
82
|
-
color: var(--cx-fg-color); // Effectively the base text color
|
|
83
|
-
word-wrap: normal;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.cxd-example-snippet .highlight pre {
|
|
88
|
-
margin-right: 0;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.highlight-toolbar {
|
|
92
|
-
background-color: var(--cxd-pre-bg, var(--cx-bg-even));
|
|
93
|
-
border-top: var(--cx-border-width) var(--cx-border-style) var(--cx-border-subtle);
|
|
94
|
-
border-bottom: var(--cx-border-width) var(--cx-border-style) var(--cx-border-subtle);
|
|
95
|
-
|
|
96
|
-
+ .highlight {
|
|
97
|
-
@include border-top-radius(0);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
> a {
|
|
101
|
-
@include font-size(var(--cx-font-size-small));
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.cxd-file-ref {
|
|
106
|
-
.highlight-toolbar {
|
|
107
|
-
border-top: 0;
|
|
108
|
-
@include media-breakpoint-up(medium) {
|
|
109
|
-
@include border-top-radius(calc(var(--cx-border-radius) - 1px));
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.cxd-content .cxd-code-snippet {
|
|
115
|
-
margin-bottom: 1rem;
|
|
116
|
-
}
|
package/src/scss/_colors.scss
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
// Colors used in Chassis Docs for custom components and syntax highlighting.
|
|
2
|
-
|
|
3
|
-
$aqua: #0cc !default;
|
|
4
|
-
$black: #000 !default;
|
|
5
|
-
$blue: #00f !default;
|
|
6
|
-
$cyan: #0cf !default;
|
|
7
|
-
$green: #090 !default;
|
|
8
|
-
$gray: #999 !default;
|
|
9
|
-
$graydark: #666 !default;
|
|
10
|
-
$fuchsia: #c0c !default;
|
|
11
|
-
$indigo: #639 !default;
|
|
12
|
-
$olive: #990 !default;
|
|
13
|
-
$orange: #f90 !default;
|
|
14
|
-
$red: #f00 !default;
|
|
15
|
-
$pink: #f39 !default;
|
|
16
|
-
$purple: #90f !default;
|
|
17
|
-
$teal: #099 !default;
|
|
18
|
-
$violet: #c3c !default;
|
|
19
|
-
$white: #fff !default;
|
|
20
|
-
$yellow: #fc0 !default;
|
|
21
|
-
|
|
22
|
-
// $gray-100: #f8f9fa !default;
|
|
23
|
-
// $gray-200: #e9ecef !default;
|
|
24
|
-
// $gray-300: #dee2e6 !default;
|
|
25
|
-
// $gray-400: #ced4da !default;
|
|
26
|
-
// $gray-500: #adb5bd !default;
|
|
27
|
-
// $gray-600: #6c757d !default;
|
|
28
|
-
// $gray-700: #495057 !default;
|
|
29
|
-
// $gray-800: #343a40 !default;
|
|
30
|
-
// $gray-900: #212529 !default;
|
|
31
|
-
|
|
32
|
-
$gray-100: tint-color($gray, 80%) !default;
|
|
33
|
-
$gray-200: tint-color($gray, 60%) !default;
|
|
34
|
-
$gray-300: tint-color($gray, 40%) !default;
|
|
35
|
-
$gray-400: tint-color($gray, 20%) !default;
|
|
36
|
-
$gray-500: $gray !default;
|
|
37
|
-
$gray-600: shade-color($gray, 20%) !default;
|
|
38
|
-
$gray-700: shade-color($gray, 40%) !default;
|
|
39
|
-
$gray-800: shade-color($gray, 60%) !default;
|
|
40
|
-
$gray-900: shade-color($gray, 80%) !default;
|
|
41
|
-
|
|
42
|
-
$blue-100: tint-color($blue, 80%) !default;
|
|
43
|
-
$blue-200: tint-color($blue, 60%) !default;
|
|
44
|
-
$blue-300: tint-color($blue, 40%) !default;
|
|
45
|
-
$blue-400: tint-color($blue, 20%) !default;
|
|
46
|
-
$blue-500: $blue !default;
|
|
47
|
-
$blue-600: shade-color($blue, 20%) !default;
|
|
48
|
-
$blue-700: shade-color($blue, 40%) !default;
|
|
49
|
-
$blue-800: shade-color($blue, 60%) !default;
|
|
50
|
-
$blue-900: shade-color($blue, 80%) !default;
|
|
51
|
-
|
|
52
|
-
$indigo-100: tint-color($indigo, 80%) !default;
|
|
53
|
-
$indigo-200: tint-color($indigo, 60%) !default;
|
|
54
|
-
$indigo-300: tint-color($indigo, 40%) !default;
|
|
55
|
-
$indigo-400: tint-color($indigo, 20%) !default;
|
|
56
|
-
$indigo-500: $indigo !default;
|
|
57
|
-
$indigo-600: shade-color($indigo, 20%) !default;
|
|
58
|
-
$indigo-700: shade-color($indigo, 40%) !default;
|
|
59
|
-
$indigo-800: shade-color($indigo, 60%) !default;
|
|
60
|
-
$indigo-900: shade-color($indigo, 80%) !default;
|
|
61
|
-
|
|
62
|
-
$purple-100: tint-color($purple, 80%) !default;
|
|
63
|
-
$purple-200: tint-color($purple, 60%) !default;
|
|
64
|
-
$purple-300: tint-color($purple, 40%) !default;
|
|
65
|
-
$purple-400: tint-color($purple, 20%) !default;
|
|
66
|
-
$purple-500: $purple !default;
|
|
67
|
-
$purple-600: shade-color($purple, 20%) !default;
|
|
68
|
-
$purple-700: shade-color($purple, 40%) !default;
|
|
69
|
-
$purple-800: shade-color($purple, 60%) !default;
|
|
70
|
-
$purple-900: shade-color($purple, 80%) !default;
|
|
71
|
-
|
|
72
|
-
$pink-100: tint-color($pink, 80%) !default;
|
|
73
|
-
$pink-200: tint-color($pink, 60%) !default;
|
|
74
|
-
$pink-300: tint-color($pink, 40%) !default;
|
|
75
|
-
$pink-400: tint-color($pink, 20%) !default;
|
|
76
|
-
$pink-500: $pink !default;
|
|
77
|
-
$pink-600: shade-color($pink, 20%) !default;
|
|
78
|
-
$pink-700: shade-color($pink, 40%) !default;
|
|
79
|
-
$pink-800: shade-color($pink, 60%) !default;
|
|
80
|
-
$pink-900: shade-color($pink, 80%) !default;
|
|
81
|
-
|
|
82
|
-
$red-100: tint-color($red, 80%) !default;
|
|
83
|
-
$red-200: tint-color($red, 60%) !default;
|
|
84
|
-
$red-300: tint-color($red, 40%) !default;
|
|
85
|
-
$red-400: tint-color($red, 20%) !default;
|
|
86
|
-
$red-500: $red !default;
|
|
87
|
-
$red-600: shade-color($red, 20%) !default;
|
|
88
|
-
$red-700: shade-color($red, 40%) !default;
|
|
89
|
-
$red-800: shade-color($red, 60%) !default;
|
|
90
|
-
$red-900: shade-color($red, 80%) !default;
|
|
91
|
-
|
|
92
|
-
$orange-100: tint-color($orange, 80%) !default;
|
|
93
|
-
$orange-200: tint-color($orange, 60%) !default;
|
|
94
|
-
$orange-300: tint-color($orange, 40%) !default;
|
|
95
|
-
$orange-400: tint-color($orange, 20%) !default;
|
|
96
|
-
$orange-500: $orange !default;
|
|
97
|
-
$orange-600: shade-color($orange, 20%) !default;
|
|
98
|
-
$orange-700: shade-color($orange, 40%) !default;
|
|
99
|
-
$orange-800: shade-color($orange, 60%) !default;
|
|
100
|
-
$orange-900: shade-color($orange, 80%) !default;
|
|
101
|
-
|
|
102
|
-
$yellow-100: tint-color($yellow, 80%) !default;
|
|
103
|
-
$yellow-200: tint-color($yellow, 60%) !default;
|
|
104
|
-
$yellow-300: tint-color($yellow, 40%) !default;
|
|
105
|
-
$yellow-400: tint-color($yellow, 20%) !default;
|
|
106
|
-
$yellow-500: $yellow !default;
|
|
107
|
-
$yellow-600: shade-color($yellow, 20%) !default;
|
|
108
|
-
$yellow-700: shade-color($yellow, 40%) !default;
|
|
109
|
-
$yellow-800: shade-color($yellow, 60%) !default;
|
|
110
|
-
$yellow-900: shade-color($yellow, 80%) !default;
|
|
111
|
-
|
|
112
|
-
$green-100: tint-color($green, 80%) !default;
|
|
113
|
-
$green-200: tint-color($green, 60%) !default;
|
|
114
|
-
$green-300: tint-color($green, 40%) !default;
|
|
115
|
-
$green-400: tint-color($green, 20%) !default;
|
|
116
|
-
$green-500: $green !default;
|
|
117
|
-
$green-600: shade-color($green, 20%) !default;
|
|
118
|
-
$green-700: shade-color($green, 40%) !default;
|
|
119
|
-
$green-800: shade-color($green, 60%) !default;
|
|
120
|
-
$green-900: shade-color($green, 80%) !default;
|
|
121
|
-
|
|
122
|
-
$teal-100: tint-color($teal, 80%) !default;
|
|
123
|
-
$teal-200: tint-color($teal, 60%) !default;
|
|
124
|
-
$teal-300: tint-color($teal, 40%) !default;
|
|
125
|
-
$teal-400: tint-color($teal, 20%) !default;
|
|
126
|
-
$teal-500: $teal !default;
|
|
127
|
-
$teal-600: shade-color($teal, 20%) !default;
|
|
128
|
-
$teal-700: shade-color($teal, 40%) !default;
|
|
129
|
-
$teal-800: shade-color($teal, 60%) !default;
|
|
130
|
-
$teal-900: shade-color($teal, 80%) !default;
|
|
131
|
-
|
|
132
|
-
$cyan-100: tint-color($cyan, 80%) !default;
|
|
133
|
-
$cyan-200: tint-color($cyan, 60%) !default;
|
|
134
|
-
$cyan-300: tint-color($cyan, 40%) !default;
|
|
135
|
-
$cyan-400: tint-color($cyan, 20%) !default;
|
|
136
|
-
$cyan-500: $cyan !default;
|
|
137
|
-
$cyan-600: shade-color($cyan, 20%) !default;
|
|
138
|
-
$cyan-700: shade-color($cyan, 40%) !default;
|
|
139
|
-
$cyan-800: shade-color($cyan, 60%) !default;
|
|
140
|
-
$cyan-900: shade-color($cyan, 80%) !default;
|