refactor(theme-classic): merge CSS files for Heading (#6759)

This commit is contained in:
Sébastien Lorber 2022-02-25 15:08:45 +01:00 committed by GitHub
parent 44a65f3337
commit 17b8eded79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 23 deletions

View File

@ -11,7 +11,6 @@ import type {Props} from '@theme/Heading';
import {translate} from '@docusaurus/Translate';
import {useThemeConfig} from '@docusaurus/theme-common';
import './styles.css';
import styles from './styles.module.css';
function AnchorHeading({as: As, id, ...props}: Props) {

View File

@ -1,22 +0,0 @@
/**
* 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.
*/
.hash-link {
opacity: 0;
padding-left: 0.5rem;
transition: opacity var(--ifm-transition-fast);
user-select: none;
}
.hash-link::before {
content: '#';
}
.hash-link:focus,
*:hover > .hash-link {
opacity: 1;
}

View File

@ -17,3 +17,19 @@ See https://twitter.com/JoshWComeau/status/1332015868725891076
.anchorWithHideOnScrollNavbar {
scroll-margin-top: 0.5rem;
}
:global(.hash-link) {
opacity: 0;
padding-left: 0.5rem;
transition: opacity var(--ifm-transition-fast);
user-select: none;
}
:global(.hash-link::before) {
content: '#';
}
:global(.hash-link:focus),
:global(*:hover > .hash-link) {
opacity: 1;
}