@skeletonlabs/skeleton 0.92.2 → 0.99.5
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/components/Accordion/AccordionGroup.svelte +22 -35
- package/components/Accordion/AccordionItem.svelte +24 -40
- package/components/AppBar/AppBar.svelte +22 -38
- package/components/AppRail/AppRail.svelte +18 -39
- package/components/AppRail/AppRailTile.svelte +23 -37
- package/components/AppShell/AppShell.svelte +28 -38
- package/components/Avatar/Avatar.svelte +16 -33
- package/components/ConicGradient/ConicGradient.svelte +28 -44
- package/components/FileButton/FileButton.svelte +14 -11
- package/components/FileDropzone/FileDropzone.svelte +26 -46
- package/components/InputChip/InputChip.svelte +39 -69
- package/components/InputChip/InputChip.svelte.d.ts +0 -1
- package/components/ListBox/ListBox.svelte +27 -47
- package/components/ListBox/ListBoxItem.svelte +36 -52
- package/components/Paginator/Paginator.svelte +25 -41
- package/components/ProgressBar/ProgressBar.svelte +18 -30
- package/components/ProgressRadial/ProgressRadial.svelte +18 -36
- package/components/Radio/RadioGroup.svelte +23 -42
- package/components/Radio/RadioItem.svelte +24 -36
- package/components/RangeSlider/RangeSlider.svelte +17 -40
- package/components/SlideToggle/SlideToggle.svelte +42 -54
- package/components/Stepper/Step.svelte +57 -65
- package/components/Stepper/Stepper.svelte +30 -51
- package/components/SvgIcon/SvgIcon.svelte +11 -23
- package/components/Tab/Tab.svelte +30 -45
- package/components/Tab/TabGroup.svelte +30 -48
- package/components/Table/Table.svelte +20 -36
- package/components/TableOfContents/TableOfContents.svelte +62 -94
- package/index.d.ts +0 -5
- package/index.js +0 -5
- package/package.json +26 -25
- package/styles/all.css +3 -0
- package/styles/core.css +11 -2
- package/styles/elements/alerts.css +2 -28
- package/styles/elements/badges.css +0 -25
- package/styles/elements/breadcrumbs.css +3 -3
- package/styles/elements/buttons.css +32 -117
- package/styles/elements/cards.css +2 -29
- package/styles/elements/chips.css +9 -58
- package/styles/elements/lists.css +4 -3
- package/styles/elements/logo-clouds.css +2 -4
- package/styles/elements/tables.css +14 -10
- package/styles/forms.css +130 -113
- package/styles/tailwind.css +7 -3
- package/styles/typography.css +46 -62
- package/styles/variants.css +154 -0
- package/tailwind/core.cjs +37 -0
- package/tailwind/core.d.cts +5 -0
- package/tailwind/generated/intellisense-classes.cjs +1 -0
- package/tailwind/generated/{allComponents.d.cts → intellisense-classes.d.cts} +731 -931
- package/tailwind/intellisense.cjs +21 -0
- package/tailwind/intellisense.d.cts +5 -0
- package/tailwind/settings.cjs +16 -16
- package/tailwind/skeleton.cjs +13 -44
- package/tailwind/skeleton.d.cts +4 -2
- package/tailwind/theme/colors.cjs +7 -7
- package/tailwind/tokens/backgrounds.cjs +28 -30
- package/tailwind/tokens/border-radius.cjs +15 -15
- package/tailwind/tokens/borders.cjs +14 -14
- package/tailwind/tokens/fills.cjs +14 -14
- package/tailwind/tokens/rings.cjs +40 -32
- package/tailwind/tokens/rings.d.cts +5 -0
- package/tailwind/tokens/text.cjs +24 -26
- package/themes/theme-skeleton.css +6 -6
- package/utilities/CodeBlock/CodeBlock.svelte +26 -40
- package/utilities/DataTable/DataTable.js +1 -1
- package/utilities/Drawer/Drawer.svelte +82 -105
- package/utilities/LightSwitch/LightSwitch.svelte +32 -50
- package/utilities/LightSwitch/LightSwitch.svelte.d.ts +1 -1
- package/utilities/Modal/Modal.svelte +57 -92
- package/utilities/Modal/examples/ModalExampleEmbed.svelte +3 -6
- package/utilities/Modal/examples/ModalExampleForm.svelte +13 -19
- package/utilities/Modal/examples/ModalExampleImage.svelte +19 -0
- package/utilities/Modal/examples/ModalExampleImage.svelte.d.ts +16 -0
- package/utilities/Modal/examples/ModalExampleList.svelte +7 -10
- package/utilities/Toast/Toast.svelte +64 -86
- package/utilities/Toast/stores.js +13 -4
- package/components/Alert/Alert.svelte +0 -65
- package/components/Alert/Alert.svelte.d.ts +0 -30
- package/components/Breadcrumb/Breadcrumb.svelte +0 -24
- package/components/Breadcrumb/Breadcrumb.svelte.d.ts +0 -21
- package/components/Breadcrumb/Crumb.svelte +0 -37
- package/components/Breadcrumb/Crumb.svelte.d.ts +0 -26
- package/components/Divider/Divider.svelte +0 -21
- package/components/Divider/Divider.svelte.d.ts +0 -22
- package/components/GradientHeading/GradientHeading.svelte +0 -21
- package/components/GradientHeading/GradientHeading.svelte.d.ts +0 -22
- package/tailwind/generated/allComponents.cjs +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// The Skeleton Intellisense Tailwind Plugin
|
|
2
|
+
// Tailwind Docs: https://tailwindcss.com/docs/plugins
|
|
3
|
+
// Skeleton Docs: https://www.skeleton.dev/guides/tailwind
|
|
4
|
+
|
|
5
|
+
const plugin = require('tailwindcss/plugin');
|
|
6
|
+
|
|
7
|
+
module.exports = plugin(({ addComponents }) => {
|
|
8
|
+
// The following will generate the non-token classes PURELY for Intellisense.
|
|
9
|
+
// These are excluded from production, which means we still need to lean into
|
|
10
|
+
// using the `all.css` stylesheet to import non-token styles.
|
|
11
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
12
|
+
// try/catch because it will throw when allComponents.cjs isn't generated yet
|
|
13
|
+
try {
|
|
14
|
+
const all = require('./generated/intellisense-classes.cjs');
|
|
15
|
+
addComponents(all, {
|
|
16
|
+
respectImportant: true,
|
|
17
|
+
respectPrefix: true
|
|
18
|
+
});
|
|
19
|
+
} catch {}
|
|
20
|
+
}
|
|
21
|
+
});
|
package/tailwind/settings.cjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
// Common Shared Settings and Constants
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
4
|
+
colorNames: ['primary', 'secondary', 'tertiary', 'success', 'warning', 'error', 'surface'],
|
|
5
|
+
colorShades: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900],
|
|
6
|
+
colorPairings: [
|
|
7
|
+
// forward:
|
|
8
|
+
{ light: 50, dark: 900 },
|
|
9
|
+
{ light: 100, dark: 800 },
|
|
10
|
+
{ light: 200, dark: 700 },
|
|
11
|
+
{ light: 300, dark: 600 },
|
|
12
|
+
{ light: 400, dark: 500 },
|
|
13
|
+
// backwards
|
|
14
|
+
{ light: 900, dark: 50 },
|
|
15
|
+
{ light: 800, dark: 100 },
|
|
16
|
+
{ light: 700, dark: 200 },
|
|
17
|
+
{ light: 600, dark: 300 },
|
|
18
|
+
{ light: 500, dark: 400 }
|
|
19
|
+
]
|
|
20
20
|
};
|
package/tailwind/skeleton.cjs
CHANGED
|
@@ -2,49 +2,18 @@
|
|
|
2
2
|
// Tailwind Docs: https://tailwindcss.com/docs/plugins
|
|
3
3
|
// Skeleton Docs: https://www.skeleton.dev/guides/tailwind
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const intellisensePlugin = require('./intellisense.cjs');
|
|
6
|
+
const corePlugin = require('./core.cjs');
|
|
6
7
|
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const tokensFills = require('./tokens/fills.cjs');
|
|
14
|
-
const tokensText = require('./tokens/text.cjs');
|
|
15
|
-
const tokensRings = require('./tokens/rings.cjs');
|
|
8
|
+
// The default export is a function that returns an array of plugins
|
|
9
|
+
// and accepts an optional config that determines which plugins are included.
|
|
10
|
+
// By default, all plugins are included.
|
|
11
|
+
module.exports = function (config = { intellisense: true }) {
|
|
12
|
+
const { intellisense } = config;
|
|
13
|
+
const plugins = [corePlugin];
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
...tokensBorders(),
|
|
23
|
-
...tokensBorderRadius(),
|
|
24
|
-
...tokensFills(),
|
|
25
|
-
...tokensText(),
|
|
26
|
-
...tokensRings()
|
|
27
|
-
});
|
|
28
|
-
// The following will generate the non-token classes PURELY for Intellisense.
|
|
29
|
-
// These are excluded from production, which means we still need to lean into
|
|
30
|
-
// using the `all.css` stylesheet to import non-token styles.
|
|
31
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
32
|
-
// try/catch because it will throw when allComponents.cjs isn't generated yet
|
|
33
|
-
try {
|
|
34
|
-
const all = require('./generated/allComponents.cjs');
|
|
35
|
-
addComponents(all, {
|
|
36
|
-
respectImportant: true,
|
|
37
|
-
respectPrefix: true
|
|
38
|
-
});
|
|
39
|
-
} catch {}
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
theme: {
|
|
44
|
-
extend: {
|
|
45
|
-
// Implement Skeleton theme colors
|
|
46
|
-
colors: themeColors()
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
);
|
|
15
|
+
// Add the plugin if the option is not explicitly set to false
|
|
16
|
+
if (intellisense !== false) plugins.push(intellisensePlugin);
|
|
17
|
+
|
|
18
|
+
return plugins;
|
|
19
|
+
};
|
package/tailwind/skeleton.d.cts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare function _exports(config?: {
|
|
2
|
+
intellisense: boolean;
|
|
3
|
+
}): {
|
|
2
4
|
handler: import("tailwindcss/types/config.js").PluginCreator;
|
|
3
5
|
config?: Partial<import("tailwindcss/types/config.js").Config> | undefined;
|
|
4
|
-
};
|
|
6
|
+
}[];
|
|
5
7
|
export = _exports;
|
|
@@ -5,14 +5,14 @@ const settings = require('../settings.cjs');
|
|
|
5
5
|
|
|
6
6
|
// ex: `50: 'rgb(var(--color-primary-50) / <alpha-value>)'`
|
|
7
7
|
function generatePaletteShades(colorName) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const shadeObj = {};
|
|
9
|
+
settings.colorShades.forEach((s) => (shadeObj[s] = `rgb(var(--color-${colorName}-${s}) / <alpha-value>)`));
|
|
10
|
+
return shadeObj;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
// Generate a a color shade palette 50-900 per each color available
|
|
14
14
|
module.exports = () => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
15
|
+
const paletteObj = {};
|
|
16
|
+
settings.colorNames.forEach((n) => (paletteObj[n] = generatePaletteShades(n)));
|
|
17
|
+
return paletteObj;
|
|
18
|
+
};
|
|
@@ -8,33 +8,31 @@ const backdropAlpha = 0.7;
|
|
|
8
8
|
const hoverAlpha = 0.1;
|
|
9
9
|
|
|
10
10
|
module.exports = () => {
|
|
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
|
-
return classes;
|
|
40
|
-
}
|
|
11
|
+
const classes = {};
|
|
12
|
+
settings.colorNames.forEach((n) => {
|
|
13
|
+
// Backdrops
|
|
14
|
+
// Example: .bg-primary-backdrop-token
|
|
15
|
+
classes[`.bg-${n}-backdrop-token`] = { 'background-color': `rgb(var(--color-${n}-400) / ${backdropAlpha})` };
|
|
16
|
+
classes[`.dark .bg-${n}-backdrop-token`] = { 'background-color': `rgb(var(--color-${n}-900) / ${backdropAlpha})` };
|
|
17
|
+
|
|
18
|
+
// Hover
|
|
19
|
+
// Example: .bg-primary-hover-token
|
|
20
|
+
classes[`.bg-${n}-hover-token:hover`] = { 'background-color': `rgb(var(--color-${n}-500) / ${hoverAlpha})` };
|
|
21
|
+
|
|
22
|
+
// Active
|
|
23
|
+
// Example: .bg-primary-active-token
|
|
24
|
+
classes[`.bg-${n}-active-token`] = {
|
|
25
|
+
'background-color': `rgb(var(--color-${n}-500)) !important`,
|
|
26
|
+
color: `rgb(var(--on-${n}))`,
|
|
27
|
+
fill: `rgb(var(--on-${n}))`
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// Color Pairings
|
|
31
|
+
// Example: .bg-primary-50-900-token | .bg-primary-900-50-token
|
|
32
|
+
settings.colorPairings.forEach((p) => {
|
|
33
|
+
classes[`.bg-${n}-${p.light}-${p.dark}-token`] = { 'background-color': `rgb(var(--color-${n}-${p.light}))` };
|
|
34
|
+
classes[`.dark .bg-${n}-${p.light}-${p.dark}-token`] = { 'background-color': `rgb(var(--color-${n}-${p.dark}))` };
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
return classes;
|
|
38
|
+
};
|
|
@@ -4,18 +4,18 @@
|
|
|
4
4
|
// const settings = require('../settings.cjs');
|
|
5
5
|
|
|
6
6
|
module.exports = () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
7
|
+
return {
|
|
8
|
+
// Base
|
|
9
|
+
'.rounded-token': { 'border-radius': 'var(--theme-rounded-base)' },
|
|
10
|
+
'.rounded-tl-token': { 'border-top-left-radius': 'var(--theme-rounded-base)' },
|
|
11
|
+
'.rounded-tr-token': { 'border-top-right-radius': 'var(--theme-rounded-base)' },
|
|
12
|
+
'.rounded-bl-token': { 'border-bottom-left-radius': 'var(--theme-rounded-base)' },
|
|
13
|
+
'.rounded-br-token': { 'border-bottom-right-radius': 'var(--theme-rounded-base)' },
|
|
14
|
+
// Container
|
|
15
|
+
'.rounded-container-token': { 'border-radius': 'var(--theme-rounded-container)' },
|
|
16
|
+
'.rounded-tl-container-token': { 'border-top-left-radius': 'var(--theme-rounded-container)' },
|
|
17
|
+
'.rounded-tr-container-token': { 'border-top-right-radius': 'var(--theme-rounded-container)' },
|
|
18
|
+
'.rounded-bl-container-token': { 'border-bottom-left-radius': 'var(--theme-rounded-container)' },
|
|
19
|
+
'.rounded-br-container-token': { 'border-bottom-right-radius': 'var(--theme-rounded-container)' }
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
const settings = require('../settings.cjs');
|
|
5
5
|
|
|
6
6
|
module.exports = () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
7
|
+
const classes = {
|
|
8
|
+
// Border Width - ex: .border-token
|
|
9
|
+
'.border-token': { 'border-width': 'var(--theme-border-base)' }
|
|
10
|
+
};
|
|
11
|
+
settings.colorNames.forEach((n) => {
|
|
12
|
+
// Color Pairings
|
|
13
|
+
// Example: .border-primary-50-900-token | .border-primary-900-50-token
|
|
14
|
+
settings.colorPairings.forEach((p) => {
|
|
15
|
+
classes[`.border-${n}-${p.light}-${p.dark}-token`] = { 'border-color': `rgb(var(--color-${n}-${p.light}))` };
|
|
16
|
+
classes[`.dark .border-${n}-${p.light}-${p.dark}-token`] = { 'border-color': `rgb(var(--color-${n}-${p.dark}))` };
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
return classes;
|
|
20
|
+
};
|
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
const settings = require('../settings.cjs');
|
|
5
5
|
|
|
6
6
|
module.exports = () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
7
|
+
const classes = {
|
|
8
|
+
'.fill-base-token': { fill: 'rgba(var(--theme-font-color-base))' },
|
|
9
|
+
'.fill-dark-token': { fill: 'rgba(var(--theme-font-color-dark))' },
|
|
10
|
+
// Fill Token - ex: .fill-token
|
|
11
|
+
'.fill-token': { fill: 'rgba(var(--theme-font-color-base))' },
|
|
12
|
+
'.dark .fill-token': { fill: 'rgba(var(--theme-font-color-dark))' }
|
|
13
|
+
};
|
|
14
|
+
settings.colorNames.forEach((n) => {
|
|
15
|
+
// On-X Fill Colors
|
|
16
|
+
// Example: .fill-on-primary-token
|
|
17
|
+
classes[`.fill-on-${n}-token`] = { fill: `rgb(var(--on-${n}))` };
|
|
18
|
+
});
|
|
19
|
+
return classes;
|
|
20
|
+
};
|
|
@@ -4,39 +4,47 @@
|
|
|
4
4
|
const settings = require('../settings.cjs');
|
|
5
5
|
|
|
6
6
|
// Local
|
|
7
|
+
const ringTokenTheme = {
|
|
8
|
+
'--tw-ring-offset-shadow': `var(--tw-ring-inset) 0 0 0 var(--theme-border-base) var(--tw-ring-offset-color)`,
|
|
9
|
+
'--tw-ring-shadow': `var(--tw-ring-inset) 0 0 0 calc(2px + var(--theme-border-base)) var(--tw-ring-color)`,
|
|
10
|
+
'box-shadow': `var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)`,
|
|
11
|
+
};
|
|
7
12
|
const ringOutlineShared = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
// .ring-[1px]
|
|
14
|
+
'--tw-ring-offset-shadow': 'var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)',
|
|
15
|
+
'--tw-ring-shadow': 'var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)',
|
|
16
|
+
'box-shadow': 'var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)',
|
|
17
|
+
// .ring-inset
|
|
18
|
+
'--tw-ring-inset': 'inset'
|
|
14
19
|
};
|
|
15
20
|
|
|
16
21
|
module.exports = () => {
|
|
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
|
-
}
|
|
22
|
+
const classes = {
|
|
23
|
+
'.ring-token': {
|
|
24
|
+
...ringTokenTheme,
|
|
25
|
+
},
|
|
26
|
+
// Ring Outline (for cards)
|
|
27
|
+
// Example: .ring-outline-token
|
|
28
|
+
'.ring-outline-token': {
|
|
29
|
+
...ringOutlineShared,
|
|
30
|
+
'--tw-ring-color': 'rgb(23 23 23 / 0.05);' // neutral-900, 5% opacity
|
|
31
|
+
},
|
|
32
|
+
'.dark .ring-outline-token': {
|
|
33
|
+
...ringOutlineShared,
|
|
34
|
+
'--tw-ring-color': 'rgb(250 250 250 / 0.05)' // neutral-50, 5% opacity
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
settings.colorNames.forEach((n) => {
|
|
38
|
+
// Color Pairings
|
|
39
|
+
// Example: .ring-primary-50-900-token | .ring-primary-900-50-token
|
|
40
|
+
settings.colorPairings.forEach((p) => {
|
|
41
|
+
classes[`.ring-${n}-${p.light}-${p.dark}-token`] = {
|
|
42
|
+
'--tw-ring-color': `rgb(var(--color-${n}-${p.light}) / 1)`
|
|
43
|
+
};
|
|
44
|
+
classes[`.dark .ring-${n}-${p.light}-${p.dark}-token`] = {
|
|
45
|
+
'--tw-ring-color': `rgb(var(--color-${n}-${p.dark}) / 1)`
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
return classes;
|
|
50
|
+
};
|
package/tailwind/tokens/text.cjs
CHANGED
|
@@ -4,30 +4,28 @@
|
|
|
4
4
|
const settings = require('../settings.cjs');
|
|
5
5
|
|
|
6
6
|
module.exports = () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
const classes = {
|
|
8
|
+
// Font Family
|
|
9
|
+
'.font-heading-token': { 'font-family': 'var(--theme-font-family-heading)' },
|
|
10
|
+
'.font-token': { 'font-family': 'var(--theme-font-family-base)' },
|
|
11
|
+
// Default Text Colors
|
|
12
|
+
'.text-base-token': { color: 'rgba(var(--theme-font-color-base))' },
|
|
13
|
+
'.text-dark-token': { color: 'rgba(var(--theme-font-color-dark))' },
|
|
14
|
+
// Light/Dark Text Color - ex: .text-token
|
|
15
|
+
'.text-token': { color: 'rgba(var(--theme-font-color-base))' },
|
|
16
|
+
'.dark .text-token': { color: 'rgba(var(--theme-font-color-dark))' }
|
|
17
|
+
};
|
|
18
|
+
settings.colorNames.forEach((n) => {
|
|
19
|
+
// On-X Text Colors
|
|
20
|
+
// Example: .text-on-primary-token
|
|
21
|
+
classes[`.text-on-${n}-token`] = { color: `rgb(var(--on-${n}))` };
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
});
|
|
32
|
-
return classes;
|
|
33
|
-
}
|
|
23
|
+
// Color Pairings
|
|
24
|
+
// Example: .text-primary-50-900-token | .text-primary-900-50-token
|
|
25
|
+
settings.colorPairings.forEach((p) => {
|
|
26
|
+
classes[`.text-${n}-${p.light}-${p.dark}-token`] = { color: `rgb(var(--color-${n}-${p.light}))` };
|
|
27
|
+
classes[`.dark .text-${n}-${p.light}-${p.dark}-token`] = { color: `rgb(var(--color-${n}-${p.dark}))` };
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
return classes;
|
|
31
|
+
};
|
|
@@ -113,13 +113,13 @@
|
|
|
113
113
|
[data-theme='skeleton'] {
|
|
114
114
|
/* prettier-ignore */
|
|
115
115
|
background-image:
|
|
116
|
-
radial-gradient(at 73% 84%, hsla(213,80%,69%,0.
|
|
117
|
-
radial-gradient(at 16% 79%, hsla(268,79%,73%,0.
|
|
118
|
-
radial-gradient(at 88% 64%, hsla(290,68%,62%,0.
|
|
119
|
-
radial-gradient(at 67% 14%, hsla(167,87%,76%,0.
|
|
120
|
-
radial-gradient(at 70% 75%, hsla(170,71%,68%,0.
|
|
116
|
+
radial-gradient(at 73% 84%, hsla(213,80%,69%,0.20) 0px, transparent 50%),
|
|
117
|
+
radial-gradient(at 16% 79%, hsla(268,79%,73%,0.20) 0px, transparent 50%),
|
|
118
|
+
radial-gradient(at 88% 64%, hsla(290,68%,62%,0.20) 0px, transparent 50%),
|
|
119
|
+
radial-gradient(at 67% 14%, hsla(167,87%,76%,0.20) 0px, transparent 50%),
|
|
120
|
+
radial-gradient(at 70% 75%, hsla(170,71%,68%,0.20) 0px, transparent 50%),
|
|
121
121
|
radial-gradient(at 98% 62%, hsla(244,77%,60%,0.18) 0px, transparent 50%),
|
|
122
|
-
radial-gradient(at 50% 19%, hsla(322,97%,63%,0.
|
|
122
|
+
radial-gradient(at 50% 19%, hsla(322,97%,63%,0.20) 0px, transparent 50%);
|
|
123
123
|
}
|
|
124
124
|
.dark [data-theme='skeleton'] {
|
|
125
125
|
/* prettier-ignore */
|
|
@@ -1,53 +1,39 @@
|
|
|
1
|
-
<script>import { createEventDispatcher } from
|
|
2
|
-
// Event Handler
|
|
1
|
+
<script>import { createEventDispatcher } from "svelte";
|
|
3
2
|
const dispatch = createEventDispatcher();
|
|
4
|
-
import { storeHighlightJs } from
|
|
5
|
-
import { clipboard } from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export let
|
|
9
|
-
|
|
10
|
-
export let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/** Provided classes to set the text color. */
|
|
17
|
-
export let color = 'text-white';
|
|
18
|
-
/** Provided classes to set the border radius. */
|
|
19
|
-
export let rounded = 'rounded-container-token';
|
|
20
|
-
/** Provided classes to set the button styles. */
|
|
21
|
-
export let buttonCopy = 'bg-white/5 hover:bg-white/10';
|
|
22
|
-
// Base Classes
|
|
23
|
-
const cBase = 'overflow-hidden shadow';
|
|
24
|
-
const cHeader = 'text-xs uppercase flex justify-between items-center p-2 pl-4';
|
|
25
|
-
const cPre = 'whitespace-pre-wrap break-all p-4 pt-1';
|
|
26
|
-
// Local
|
|
3
|
+
import { storeHighlightJs } from "./stores";
|
|
4
|
+
import { clipboard } from "../../actions/Clipboard/clipboard";
|
|
5
|
+
export let language = "plaintext";
|
|
6
|
+
export let code = "";
|
|
7
|
+
export let background = "bg-[#141517]";
|
|
8
|
+
export let text = "text-sm";
|
|
9
|
+
export let color = "text-white";
|
|
10
|
+
export let rounded = "rounded-container-token";
|
|
11
|
+
export let buttonCopy = "bg-white/5 hover:bg-white/10";
|
|
12
|
+
const cBase = "overflow-hidden shadow";
|
|
13
|
+
const cHeader = "text-xs uppercase flex justify-between items-center p-2 pl-4";
|
|
14
|
+
const cPre = "whitespace-pre-wrap break-all p-4 pt-1";
|
|
27
15
|
let formatted = false;
|
|
28
16
|
let displayCode = code;
|
|
29
17
|
let copyState = false;
|
|
30
|
-
// Allow shorthand 'js' alias for Javascript
|
|
31
18
|
function languageFormatter(lang) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
19
|
+
if (lang === "js")
|
|
20
|
+
return "javascript";
|
|
21
|
+
return lang;
|
|
35
22
|
}
|
|
36
|
-
// Handle Copy Text
|
|
37
23
|
function onCopyClick() {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
24
|
+
copyState = true;
|
|
25
|
+
setTimeout(() => {
|
|
26
|
+
copyState = false;
|
|
27
|
+
}, 2e3);
|
|
28
|
+
dispatch("copy", {});
|
|
43
29
|
}
|
|
44
|
-
|
|
45
|
-
|
|
30
|
+
$:
|
|
31
|
+
if ($storeHighlightJs !== void 0) {
|
|
46
32
|
displayCode = $storeHighlightJs.highlight(code, { language }).value.trim();
|
|
47
33
|
formatted = true;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
34
|
+
}
|
|
35
|
+
$:
|
|
36
|
+
classesBase = `${cBase} ${background} ${text} ${color} ${rounded} ${$$props.class ?? ""}`;
|
|
51
37
|
</script>
|
|
52
38
|
|
|
53
39
|
<!-- prettier-ignore -->
|