fix(v2): use infima from npm instead of trunk CDN (#1556)

This commit is contained in:
Yangshun Tay 2019-06-04 00:46:31 -07:00 committed by GitHub
parent c06ccc0a07
commit 246c1814c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 76 additions and 29 deletions

View file

@ -10,6 +10,7 @@
"dependencies": {
"classnames": "^2.2.6",
"docsearch.js": "^2.5.2",
"infima": "0.2.0-alpha.1",
"react-toggle": "^4.0.2"
},
"peerDependencies": {

View file

@ -14,5 +14,9 @@ module.exports = function() {
getThemePath() {
return path.resolve(__dirname, './theme');
},
getClientModules() {
return [path.resolve(__dirname, './infima')];
},
};
};

View 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';

View file

@ -5,23 +5,12 @@
* LICENSE file in the root directory of this source tree.
*/
/* These rules should eventually go into Infima */
body {
margin: 0;
padding-top: var(--ifm-navbar-height);
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 {
display: block;
position: relative;

View file

@ -11,7 +11,6 @@ import {renderRoutes} from 'react-router-config';
import routes from '@generated/routes';
import siteConfig from '@generated/docusaurus.config';
import Head from '@docusaurus/Head';
import DocusaurusContext from '@docusaurus/context';
import PendingNavigation from './PendingNavigation';
@ -20,15 +19,6 @@ import '@generated/client-modules';
function App() {
return (
<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}>
{renderRoutes(routes)}
</PendingNavigation>

View file

@ -72,8 +72,9 @@ export async function load(
// Plugins.
const pluginConfigs: PluginConfig[] = [
...presetPlugins,
...(siteConfig.plugins || []),
...presetThemes,
// Site config should the highest priority.
...(siteConfig.plugins || []),
...(siteConfig.themes || []),
];
const {plugins, pluginsRouteConfigs} = await loadPlugins({

View file

@ -109,4 +109,12 @@ module.exports = {
},
],
],
plugins: [
{
module: require('path').resolve(
__dirname,
'./plugins/plugin-infima-overrides',
),
},
],
};

View file

@ -55,7 +55,7 @@
}
.index-hero-project-keywords {
color: #25c2a0;
color: var(--ifm-color-primary);
}
@keyframes jackInTheBox {
@ -65,15 +65,15 @@
transform-origin: center bottom;
}
50% {
50% {
transform: rotate(-10deg);
}
70% {
70% {
transform: rotate(3deg);
}
to {
to {
opacity: 1;
transform: scale(1);
}
@ -93,12 +93,12 @@
}
.index-ctas-get-started-button {
border: 1px solid #25c2a0;
border: 1px solid var(--ifm-color-primary);
display: inline-block;
line-height: 1.2em;
text-decoration: none!important;
text-decoration: none !important;
text-transform: uppercase;
transition: background .3s,color .3s;
transition: background 0.3s, color 0.3s;
border-radius: 8px;
border-width: 2px;
color: #fff;

View 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')];
},
};
};

View 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-variables.css';

View 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);
}

View file

@ -7317,6 +7317,11 @@ indexof@0.0.1:
resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d"
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:
version "1.0.6"
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"