@xyd-js/theme-picasso 0.1.0-xyd.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/CHANGELOG.md +25 -0
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +27586 -0
- package/dist/index.js.map +1 -0
- package/package.json +59 -0
- package/rollup.config.js +85 -0
- package/src/imports.css +1 -0
- package/src/index.css +6 -0
- package/src/index.ts +1 -0
- package/src/override.css +105 -0
- package/src/syntaxHighlight.ts +1082 -0
- package/src/theme.tsx +71 -0
- package/src/vars.css +72 -0
- package/tsconfig.json +40 -0
package/src/theme.tsx
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
|
|
3
|
+
import {Hr, Heading} from "@xyd-js/components/writer"
|
|
4
|
+
import {UISidebar} from "@xyd-js/ui"
|
|
5
|
+
import {FwLogo, FwNav, SurfaceTarget} from "@xyd-js/framework/react"
|
|
6
|
+
import {BaseTheme} from "@xyd-js/themes"
|
|
7
|
+
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
import {SearchButton} from 'virtual-component:Search'
|
|
10
|
+
|
|
11
|
+
import syntaxHighlight from "./syntaxHighlight"
|
|
12
|
+
|
|
13
|
+
import "./imports.css"
|
|
14
|
+
|
|
15
|
+
import "@xyd-js/themes/index.css"
|
|
16
|
+
|
|
17
|
+
import './index.css';
|
|
18
|
+
import './override.css';
|
|
19
|
+
import './vars.css';
|
|
20
|
+
|
|
21
|
+
export default class ThemePicasso extends BaseTheme {
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
|
|
25
|
+
if (this.settings?.coder) {
|
|
26
|
+
this.settings.coder.syntaxHighlight = syntaxHighlight;
|
|
27
|
+
} else {
|
|
28
|
+
this.settings.coder = {
|
|
29
|
+
syntaxHighlight: syntaxHighlight,
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
this.surfaces.define(SurfaceTarget.SidebarTop, <_Search/>);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
protected Navbar() {
|
|
37
|
+
return <>
|
|
38
|
+
<FwNav />
|
|
39
|
+
</>
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
public override reactContentComponents() {
|
|
43
|
+
const components = super.reactContentComponents();
|
|
44
|
+
const H2 = components.h2;
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
...components,
|
|
48
|
+
h2: (props: any) => {
|
|
49
|
+
return <>
|
|
50
|
+
<Hr/>
|
|
51
|
+
<H2 {...props}/>
|
|
52
|
+
</>
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function _Search() {
|
|
59
|
+
return <>
|
|
60
|
+
<UISidebar.Item button anchor>
|
|
61
|
+
<a href="/">
|
|
62
|
+
<FwLogo/>
|
|
63
|
+
</a>
|
|
64
|
+
</UISidebar.Item>
|
|
65
|
+
|
|
66
|
+
<UISidebar.Item button anchor>
|
|
67
|
+
<SearchButton/>
|
|
68
|
+
</UISidebar.Item>
|
|
69
|
+
</>
|
|
70
|
+
}
|
|
71
|
+
|
package/src/vars.css
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/* Core */
|
|
2
|
+
:root {
|
|
3
|
+
--dark8: color(display-p3 .008 .184 .125 / .067);
|
|
4
|
+
--dark32: color(display-p3 .012 .094 .051 / .095);
|
|
5
|
+
--color-text: color(display-p3 0.107 0.129 0.118);
|
|
6
|
+
--color-primary: color(display-p3 0.08 0.5 0.43);
|
|
7
|
+
--color-primary--active: color(display-p3 0.08 0.5 0.43);
|
|
8
|
+
|
|
9
|
+
--xyd-banner-bgcolor: color(display-p3 .004 .643 .494 / .24);
|
|
10
|
+
--xyd-sidebar-bgcolor: var(--white);
|
|
11
|
+
--xyd-subnav-bgcolor: var(--white);
|
|
12
|
+
|
|
13
|
+
/* Font Sizes */
|
|
14
|
+
--xyd-font-size-xsmall: 13px;
|
|
15
|
+
--xyd-font-size-small: 14px;
|
|
16
|
+
--xyd-font-size-medium: 17px;
|
|
17
|
+
--xyd-font-size-large: 19px;
|
|
18
|
+
--xyd-font-size-xlarge: 23px;
|
|
19
|
+
--xyd-font-size-xxlarge: 27px;
|
|
20
|
+
--xyd-font-size-2xl: 33px;
|
|
21
|
+
|
|
22
|
+
/* Line Heights */
|
|
23
|
+
--xyd-line-height-xsmall: 17px;
|
|
24
|
+
--xyd-line-height-small: 20px;
|
|
25
|
+
--xyd-line-height-medium: 26px;
|
|
26
|
+
--xyd-line-height-large: 28px;
|
|
27
|
+
--xyd-line-height-xlarge: 34px;
|
|
28
|
+
--xyd-line-height-xxlarge: 40px;
|
|
29
|
+
--xyd-line-height-2xl: 45px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Utils */
|
|
33
|
+
:root {
|
|
34
|
+
--xyd-page-gutter: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* Code */
|
|
38
|
+
:root {
|
|
39
|
+
--xyd-codetabs-color: var(--white);
|
|
40
|
+
|
|
41
|
+
--xyd-coder-code-mark-bgcolor: var(--dark80);
|
|
42
|
+
--xyd-coder-code-mark-border-color: var(--color-primary);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* Atlas */
|
|
46
|
+
:root {
|
|
47
|
+
--XydAtlas-Ref-Palette-White: var(--white);
|
|
48
|
+
--XydAtlas-Ref-Palette-Primary-60: var(--color-primary);
|
|
49
|
+
--XydAtlas-Ref-Palette-Primary-70: var(--color-primary--active);
|
|
50
|
+
--XydAtlas-Ref-Palette-Primary-80: var(--color-primary--active);
|
|
51
|
+
|
|
52
|
+
--XydAtlas-Ref-Palette-Neutral-10: var(--dark8);
|
|
53
|
+
--XydAtlas-Ref-Palette-Neutral-20: var(--dark16);
|
|
54
|
+
--XydAtlas-Ref-Palette-Neutral-30: var(--dark32);
|
|
55
|
+
--XydAtlas-Ref-Palette-Neutral-40: var(--dark40);
|
|
56
|
+
--XydAtlas-Ref-Palette-Neutral-70: var(--dark48);
|
|
57
|
+
--XydAtlas-Ref-Palette-Neutral-80: var(--dark60);
|
|
58
|
+
--XydAtlas-Ref-Palette-Neutral-100: var(--dark80);
|
|
59
|
+
|
|
60
|
+
--XydAtlas-Sys-Color-Text-Primary: var(--color-text);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
[data-color-scheme="dark"] {
|
|
64
|
+
--xyd-codetabs-color: var(--black);
|
|
65
|
+
--color-text: var(--black);
|
|
66
|
+
}
|
|
67
|
+
@media (prefers-color-scheme: dark) {
|
|
68
|
+
:root:not([data-color-scheme="light"]):not([data-color-scheme="dark"]) {
|
|
69
|
+
--xyd-codetabs-color: var(--black);
|
|
70
|
+
--color-text: var(--black);
|
|
71
|
+
}
|
|
72
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"paths": {
|
|
4
|
+
"@xyd-js/themes": ["../xyd-themes/src"],
|
|
5
|
+
},
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"module": "esnext",
|
|
8
|
+
"moduleResolution": "bundler",
|
|
9
|
+
"target": "ES6",
|
|
10
|
+
"lib": [
|
|
11
|
+
"dom",
|
|
12
|
+
"dom.iterable",
|
|
13
|
+
"esnext"
|
|
14
|
+
],
|
|
15
|
+
"allowJs": true,
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
"strict": false,
|
|
18
|
+
"noEmit": true,
|
|
19
|
+
"incremental": false,
|
|
20
|
+
"resolveJsonModule": true,
|
|
21
|
+
"isolatedModules": true,
|
|
22
|
+
"jsx": "react",
|
|
23
|
+
"plugins": [
|
|
24
|
+
{
|
|
25
|
+
"name": "next"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"strictNullChecks": true
|
|
29
|
+
},
|
|
30
|
+
"include": [
|
|
31
|
+
"packages/css/src",
|
|
32
|
+
"next-env.d.ts",
|
|
33
|
+
"**/*.ts",
|
|
34
|
+
"**/*.tsx",
|
|
35
|
+
".next/types/**/*.ts"
|
|
36
|
+
],
|
|
37
|
+
"exclude": [
|
|
38
|
+
"node_modules"
|
|
39
|
+
]
|
|
40
|
+
}
|