diff --git a/src/components/Markdown/Markdown.scss b/src/components/Markdown/Markdown.scss index 102130d6b04d..d144c406f575 100644 --- a/src/components/Markdown/Markdown.scss +++ b/src/components/Markdown/Markdown.scss @@ -359,10 +359,31 @@ $topHeightMobileWithBanner: $bannerHeight + $topHeightMobile; a code { color: $text-color-highlight; } - a { - text-decoration: underline; - text-underline-offset: 2px; - text-decoration-thickness: 1px; + p a, + li a { + color: #1f5fbf; + text-decoration: none; + font-weight: 600; + } + p a:hover, + li a:hover { + color: #174ea6; + } + + .dark p a, + .dark li a { + color: #58a6ff; + } + + .dark p a:hover, + .dark li a:hover { + color: #79c0ff; + } + + p a:focus-visible, + li a:focus-visible { + outline: 2px solid currentColor; + outline-offset: 2px; } pre { background-color: #2d3748; diff --git a/src/components/Navigation/Navigation.jsx b/src/components/Navigation/Navigation.jsx index e5c573e0a96d..97163090307c 100644 --- a/src/components/Navigation/Navigation.jsx +++ b/src/components/Navigation/Navigation.jsx @@ -240,7 +240,7 @@ function Navigation({ links, pathname, hash = "", toggleSidebar }) { > {link.children.map((child) => { const classNames = - "text-blue-400 dark:text-[#69a8ee] py-5 text-sm capitalize hover:text-black dark:hover:text-white"; + "text-blue-800 dark:text-blue-300 py-5 text-sm capitalize hover:text-blue-800 dark:hover:text-blwue-300"; const isActive = location.pathname.startsWith(child.url); return ( props.content.default || props.content, ); - const content = isDynamicContent - ? dynamicContent - : props.content.default || props.content; - const [contentLoaded, setContentLoaded] = useState(!isDynamicContent); useEffect(() => { @@ -46,7 +44,6 @@ export default function Page(props) { }, [props.content]); const { hash, pathname } = useLocation(); - const isBlogIndex = pathname === "/blog/"; useEffect(() => { let observer; @@ -55,15 +52,13 @@ export default function Page(props) { const target = document.querySelector("#md-content"); // two cases here // 1. server side rendered page, so hash target is already there - // Note: Why this change because we use getElementById instead of querySelector(hash) here because - // CSS selectors cannot start with a digit (e.g. #11-in-scope is invalid) - if (document.getElementById(hash.slice(1))) { - document.getElementById(hash.slice(1)).scrollIntoView(); + if (document.querySelector(hash)) { + document.querySelector(hash).scrollIntoView(); } else { // 2. dynamic loaded content // we need to observe the dom change to tell if hash exists observer = new MutationObserver(() => { - const element = document.getElementById(hash.slice(1)); + const element = document.querySelector(hash); if (element) { element.scrollIntoView(); } @@ -104,12 +99,9 @@ export default function Page(props) { ); } return ( -
+

{title}

- {rest.date && pathname.startsWith("/blog/") && !isBlogIndex && ( -
{rest.date}
- )} {rest.thirdParty ? (
@@ -122,27 +114,6 @@ export default function Page(props) {
{contentRender}
- {rest.url === "/blog/" && ( -
- {(props.pages || []) - .filter((post) => post.url !== "/blog/") - .map((post) => ( -
-

- {post.title} -

- {post.date && ( -
{post.date}
- )} -

{post.teaser}

- - Read More → - -
- ))} -
- )} - {loadRelated && (

Further Reading

@@ -158,7 +129,7 @@ export default function Page(props) { - {!isBlogIndex && (previous || next) && ( + {(previous || next) && ( )} @@ -172,7 +143,7 @@ export default function Page(props) {
)} -
+ ); } @@ -182,7 +153,6 @@ Page.propTypes = { related: PropTypes.array, previous: PropTypes.object, next: PropTypes.object, - pages: PropTypes.array, content: PropTypes.oneOfType([ PropTypes.string, PropTypes.func, diff --git a/src/components/Sidebar/Sidebar.jsx b/src/components/Sidebar/Sidebar.jsx index 64e2ee3ba70f..6ece469b3300 100644 --- a/src/components/Sidebar/Sidebar.jsx +++ b/src/components/Sidebar/Sidebar.jsx @@ -31,11 +31,7 @@ export default function Sidebar({ className = "", pages, currentPage }) {