Skip to content

Commit ba893d4

Browse files
cheng-tancorleroux
authored andcommitted
fix website production css (microsoft#1366)
* fix website production css * add yarn.lock
1 parent 4b65e01 commit ba893d4

File tree

4 files changed

+615
-44
lines changed

4 files changed

+615
-44
lines changed

website/docusaurus.config.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
const math = require("remark-math");
33
const katex = require("rehype-katex");
44

5+
customPostCssPlugin = () => {
6+
return {
7+
name: "custom-postcss",
8+
configurePostCss(options) {
9+
options.plugins.push(require("postcss-preset-env"));
10+
return options;
11+
}
12+
};
13+
}
14+
515
module.exports = {
616
title: "AutoGen",
717
tagline: "Enable Next-Gen Large Language Model Applications",
@@ -145,7 +155,6 @@ module.exports = {
145155
],
146156

147157
plugins: [
148-
// ... Your other plugins.
149158
[
150159
require.resolve("@easyops-cn/docusaurus-search-local"),
151160
{
@@ -160,5 +169,6 @@ module.exports = {
160169
// When applying `zh` in language, please install `nodejieba` in your project.
161170
},
162171
],
172+
customPostCssPlugin
163173
],
164174
};

website/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"hast-util-is-element": "1.1.0",
3737
"joi": "17.6.0",
3838
"minimatch": "3.0.5",
39+
"postcss-preset-env": "^9.3.0",
3940
"react": "^18.2.0",
4041
"react-dom": "^18.2.0",
4142
"rehype-katex": "4",
@@ -45,7 +46,8 @@
4546
},
4647
"devDependencies": {
4748
"@docusaurus/module-type-aliases": "^3.1.0",
48-
"@docusaurus/types": "^3.1.0"
49+
"@docusaurus/types": "^3.1.0",
50+
"postcss": "^8.4"
4951
},
5052
"browserslist": {
5153
"production": [

website/src/css/custom.css

+43-38
Original file line numberDiff line numberDiff line change
@@ -38,39 +38,6 @@ blockquote {
3838
background-color: #0c4da224;
3939
}
4040

41-
html[data-theme="dark"] {
42-
--ifm-hero-text-color: white;
43-
--ifm-navbar-search-input-placeholder-color: #8a8d91;
44-
--ifm-navbar-link-hover-color: #0c90ff;
45-
--ifm-menu-color-active: #0c90ff;
46-
--ifm-link-color: #1084ff/*#107eff*/;
47-
48-
.table-of-contents__link--active {
49-
color: #0c7eff;
50-
}
51-
52-
.hero.hero--primary {
53-
--ifm-hero-text-color: white;
54-
}
55-
56-
blockquote {
57-
--ifm-color-emphasis-300: var(--ifm-color-primary);
58-
}
59-
60-
a code {
61-
color: #10a5ff;
62-
}
63-
64-
/* Docusaurus still defaults to their green! */
65-
.react-toggle-thumb {
66-
border-color: var(--ifm-color-primary) !important;
67-
}
68-
69-
.docusaurus-highlight-code-line {
70-
background-color: rgb(0, 0, 0, 0.3);
71-
}
72-
}
73-
7441
.header-github-link:hover {
7542
opacity: 0.6;
7643
}
@@ -84,11 +51,6 @@ html[data-theme="dark"] {
8451
no-repeat;
8552
}
8653

87-
html[data-theme="dark"] .header-github-link:before {
88-
background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='white' d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")
89-
no-repeat;
90-
}
91-
9254
.tags-container {
9355
display: flex; /* Use flexbox to lay out tags inline */
9456
flex-wrap: wrap;
@@ -110,3 +72,46 @@ html[data-theme="dark"] .header-github-link:before {
11072
background-color: #1273ce;
11173
color: white;
11274
}
75+
76+
html[data-theme="dark"] {
77+
--ifm-breadcrumb-color-active: #0c90ff;
78+
--ifm-hero-text-color: white;
79+
--ifm-link-color: #1084ff;
80+
--ifm-menu-color-active: #0c90ff;
81+
--ifm-navbar-search-input-placeholder-color: #8a8d91;
82+
--ifm-navbar-link-hover-color: #0c90ff;
83+
84+
.table-of-contents__link--active {
85+
color: #0c84ff;
86+
}
87+
88+
a[class^=sidebarItem][aria-current='page'] {
89+
color: #0c84ff !important;
90+
}
91+
92+
.hero.hero--primary {
93+
--ifm-hero-text-color: white;
94+
}
95+
96+
blockquote {
97+
--ifm-color-emphasis-300: var(--ifm-color-primary);
98+
}
99+
100+
a code {
101+
color: #10a5ff;
102+
}
103+
104+
/* Docusaurus still defaults to their green! */
105+
.react-toggle-thumb {
106+
border-color: var(--ifm-color-primary) !important;
107+
}
108+
109+
.docusaurus-highlight-code-line {
110+
background-color: rgb(0, 0, 0, 0.3);
111+
}
112+
113+
.header-github-link:before {
114+
background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='white' d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")
115+
no-repeat;
116+
}
117+
}

0 commit comments

Comments
 (0)