mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 08:49:51 +02:00
refactor: redesign admonitions/callouts/quotes (#5193)
* prepare admonitions redesign * Docusaurus admonition cleanup * cover more edge cases in Docusaurus admonitions page: interleaving code blocks and links * cover more edge cases in Docusaurus admonitions page: interleaving code blocks and links * update Infima with new alerts
This commit is contained in:
parent
24156efcfb
commit
083037d7a5
8 changed files with 104 additions and 47 deletions
|
@ -101,16 +101,6 @@ export default function pluginContentBlog(
|
|||
);
|
||||
},
|
||||
|
||||
getClientModules() {
|
||||
const modules = [];
|
||||
|
||||
if (options.admonitions) {
|
||||
modules.push(require.resolve('remark-admonitions/styles/infima.css'));
|
||||
}
|
||||
|
||||
return modules;
|
||||
},
|
||||
|
||||
// Fetches blog contents and returns metadata for the necessary routes.
|
||||
async loadContent() {
|
||||
const {postsPerPage, routeBasePath} = options;
|
||||
|
|
|
@ -110,14 +110,6 @@ export default function pluginContentDocs(
|
|||
return getLoadedContentTranslationFiles(content);
|
||||
},
|
||||
|
||||
getClientModules() {
|
||||
const modules = [];
|
||||
if (options.admonitions) {
|
||||
modules.push(require.resolve('remark-admonitions/styles/infima.css'));
|
||||
}
|
||||
return modules;
|
||||
},
|
||||
|
||||
getPathsToWatch() {
|
||||
function getVersionPathsToWatch(version: VersionMetadata): string[] {
|
||||
const result = [
|
||||
|
|
|
@ -93,16 +93,6 @@ export default function pluginContentPages(
|
|||
);
|
||||
},
|
||||
|
||||
getClientModules() {
|
||||
const modules = [];
|
||||
|
||||
if (options.admonitions) {
|
||||
modules.push(require.resolve('remark-admonitions/styles/infima.css'));
|
||||
}
|
||||
|
||||
return modules;
|
||||
},
|
||||
|
||||
async loadContent() {
|
||||
const {include} = options;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
"copy-text-to-clipboard": "^3.0.1",
|
||||
"fs-extra": "^10.0.0",
|
||||
"globby": "^11.0.2",
|
||||
"infima": "0.2.0-alpha.26",
|
||||
"infima": "0.2.0-alpha.27",
|
||||
"lodash": "^4.17.20",
|
||||
"parse-numeric-range": "^1.2.0",
|
||||
"postcss": "^8.2.15",
|
||||
|
|
35
packages/docusaurus-theme-classic/src/admonitions.css
Normal file
35
packages/docusaurus-theme-classic/src/admonitions.css
Normal file
|
@ -0,0 +1,35 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
.admonition h5 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 8px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.admonition-icon {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-right: 0.4em;
|
||||
}
|
||||
|
||||
.admonition-icon svg {
|
||||
display: inline-block;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
stroke-width: 0;
|
||||
fill: var(--ifm-alert-emphasis-color);
|
||||
stroke: var(--ifm-alert-emphasis-color);
|
||||
}
|
||||
|
||||
.admonition-content > :last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.admonition {
|
||||
margin-bottom: 1em;
|
||||
}
|
|
@ -145,6 +145,7 @@ export default function docusaurusThemeClassic(
|
|||
const modules = [
|
||||
require.resolve(getInfimaCSSFile(direction)),
|
||||
path.resolve(__dirname, './prism-include-languages'),
|
||||
path.resolve(__dirname, './admonitions.css'),
|
||||
];
|
||||
|
||||
if (customCss) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue