mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 10:20:09 +02:00
fix(v2): use infima from npm instead of trunk CDN (#1556)
This commit is contained in:
parent
c06ccc0a07
commit
246c1814c0
12 changed files with 76 additions and 29 deletions
|
@ -10,6 +10,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"classnames": "^2.2.6",
|
"classnames": "^2.2.6",
|
||||||
"docsearch.js": "^2.5.2",
|
"docsearch.js": "^2.5.2",
|
||||||
|
"infima": "0.2.0-alpha.1",
|
||||||
"react-toggle": "^4.0.2"
|
"react-toggle": "^4.0.2"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|
|
@ -14,5 +14,9 @@ module.exports = function() {
|
||||||
getThemePath() {
|
getThemePath() {
|
||||||
return path.resolve(__dirname, './theme');
|
return path.resolve(__dirname, './theme');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getClientModules() {
|
||||||
|
return [path.resolve(__dirname, './infima')];
|
||||||
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
8
packages/docusaurus-theme-classic/src/infima.js
Normal file
8
packages/docusaurus-theme-classic/src/infima.js
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2017-present, Facebook, Inc.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import 'infima/dist/css/default/default.css';
|
|
@ -5,23 +5,12 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* These rules should eventually go into Infima */
|
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding-top: var(--ifm-navbar-height);
|
padding-top: var(--ifm-navbar-height);
|
||||||
transition: var(--ifm-transition-fast) ease color;
|
transition: var(--ifm-transition-fast) ease color;
|
||||||
}
|
}
|
||||||
|
|
||||||
:root {
|
|
||||||
--ifm-color-primary: #25c2a0 !important;
|
|
||||||
--ifm-color-primary-dark: #21ad8e !important;
|
|
||||||
--ifm-color-primary-darker: #1d977d !important;
|
|
||||||
--ifm-color-primary-darkerer: #0c4236 !important;
|
|
||||||
--ifm-color-primary-light: #55dfc1 !important;
|
|
||||||
--ifm-color-primary-lighter: #55dfc1 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.anchor {
|
.anchor {
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
|
@ -11,7 +11,6 @@ import {renderRoutes} from 'react-router-config';
|
||||||
import routes from '@generated/routes';
|
import routes from '@generated/routes';
|
||||||
import siteConfig from '@generated/docusaurus.config';
|
import siteConfig from '@generated/docusaurus.config';
|
||||||
|
|
||||||
import Head from '@docusaurus/Head';
|
|
||||||
import DocusaurusContext from '@docusaurus/context';
|
import DocusaurusContext from '@docusaurus/context';
|
||||||
import PendingNavigation from './PendingNavigation';
|
import PendingNavigation from './PendingNavigation';
|
||||||
|
|
||||||
|
@ -20,15 +19,6 @@ import '@generated/client-modules';
|
||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
<DocusaurusContext.Provider value={{siteConfig}}>
|
<DocusaurusContext.Provider value={{siteConfig}}>
|
||||||
{/* TODO: this link stylesheet to infima is temporary */}
|
|
||||||
<Head>
|
|
||||||
<link
|
|
||||||
href="https://infima-dev.netlify.com/css/default/default.min.css"
|
|
||||||
preload
|
|
||||||
rel="stylesheet"
|
|
||||||
type="text/css"
|
|
||||||
/>
|
|
||||||
</Head>
|
|
||||||
<PendingNavigation routes={routes}>
|
<PendingNavigation routes={routes}>
|
||||||
{renderRoutes(routes)}
|
{renderRoutes(routes)}
|
||||||
</PendingNavigation>
|
</PendingNavigation>
|
||||||
|
|
|
@ -72,8 +72,9 @@ export async function load(
|
||||||
// Plugins.
|
// Plugins.
|
||||||
const pluginConfigs: PluginConfig[] = [
|
const pluginConfigs: PluginConfig[] = [
|
||||||
...presetPlugins,
|
...presetPlugins,
|
||||||
...(siteConfig.plugins || []),
|
|
||||||
...presetThemes,
|
...presetThemes,
|
||||||
|
// Site config should the highest priority.
|
||||||
|
...(siteConfig.plugins || []),
|
||||||
...(siteConfig.themes || []),
|
...(siteConfig.themes || []),
|
||||||
];
|
];
|
||||||
const {plugins, pluginsRouteConfigs} = await loadPlugins({
|
const {plugins, pluginsRouteConfigs} = await loadPlugins({
|
||||||
|
|
|
@ -109,4 +109,12 @@ module.exports = {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
plugins: [
|
||||||
|
{
|
||||||
|
module: require('path').resolve(
|
||||||
|
__dirname,
|
||||||
|
'./plugins/plugin-infima-overrides',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.index-hero-project-keywords {
|
.index-hero-project-keywords {
|
||||||
color: #25c2a0;
|
color: var(--ifm-color-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes jackInTheBox {
|
@keyframes jackInTheBox {
|
||||||
|
@ -65,15 +65,15 @@
|
||||||
transform-origin: center bottom;
|
transform-origin: center bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
50% {
|
50% {
|
||||||
transform: rotate(-10deg);
|
transform: rotate(-10deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
70% {
|
70% {
|
||||||
transform: rotate(3deg);
|
transform: rotate(3deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: scale(1);
|
transform: scale(1);
|
||||||
}
|
}
|
||||||
|
@ -93,12 +93,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.index-ctas-get-started-button {
|
.index-ctas-get-started-button {
|
||||||
border: 1px solid #25c2a0;
|
border: 1px solid var(--ifm-color-primary);
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
line-height: 1.2em;
|
line-height: 1.2em;
|
||||||
text-decoration: none!important;
|
text-decoration: none !important;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
transition: background .3s,color .3s;
|
transition: background 0.3s, color 0.3s;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
border-width: 2px;
|
border-width: 2px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|
17
website/plugins/plugin-infima-overrides/index.js
Normal file
17
website/plugins/plugin-infima-overrides/index.js
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2017-present, Facebook, Inc.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
module.exports = function() {
|
||||||
|
return {
|
||||||
|
name: 'docusaurus-plugin-website-infima',
|
||||||
|
getClientModules() {
|
||||||
|
return [path.resolve(__dirname, './infima-overrides')];
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
|
@ -0,0 +1,8 @@
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2017-present, Facebook, Inc.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import './infima-variables.css';
|
16
website/plugins/plugin-infima-overrides/infima-variables.css
Normal file
16
website/plugins/plugin-infima-overrides/infima-variables.css
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2017-present, Facebook, Inc.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--ifm-color-primary: #25c2a0;
|
||||||
|
--ifm-color-primary-dark: rgb(33, 175, 144);
|
||||||
|
--ifm-color-primary-darker: rgb(31, 165, 136);
|
||||||
|
--ifm-color-primary-darkest: rgb(26, 136, 112);
|
||||||
|
--ifm-color-primary-light: rgb(70, 203, 174);
|
||||||
|
--ifm-color-primary-lighter: rgb(102, 212, 189);
|
||||||
|
--ifm-color-primary-lightest: rgb(146, 224, 208);
|
||||||
|
}
|
|
@ -7317,6 +7317,11 @@ indexof@0.0.1:
|
||||||
resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d"
|
resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d"
|
||||||
integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=
|
integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=
|
||||||
|
|
||||||
|
infima@0.2.0-alpha.1:
|
||||||
|
version "0.2.0-alpha.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/infima/-/infima-0.2.0-alpha.1.tgz#f29ed163d84b3754788cc4a23fdbcc6fa96fdd1e"
|
||||||
|
integrity sha512-MkKiboxvTF1tSHQIuq5PquV2vrZ7gdPr9/VGxwVfN5/V814fIrzToiT7l5VYaqEJdMrMQ9EZNSds9IzbqwyESA==
|
||||||
|
|
||||||
inflight@^1.0.4:
|
inflight@^1.0.4:
|
||||||
version "1.0.6"
|
version "1.0.6"
|
||||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue