Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@docusaurus/theme-common
Advanced tools
@docusaurus/theme-common is a package that provides common utilities and components for building themes in Docusaurus, a popular static site generator. It includes shared components, hooks, and utilities that can be used to create custom themes or extend existing ones.
useThemeConfig
The `useThemeConfig` hook allows you to access the theme configuration in your components. This is useful for customizing the appearance and behavior of your site based on the theme settings.
import { useThemeConfig } from '@docusaurus/theme-common';
const MyComponent = () => {
const themeConfig = useThemeConfig();
return <div>{JSON.stringify(themeConfig)}</div>;
};
useColorMode
The `useColorMode` hook provides access to the current color mode (light or dark) and a function to toggle it. This is useful for implementing dark mode support in your custom themes.
import { useColorMode } from '@docusaurus/theme-common';
const MyComponent = () => {
const { colorMode, setColorMode } = useColorMode();
return (
<div>
<p>Current color mode: {colorMode}</p>
<button onClick={() => setColorMode(colorMode === 'dark' ? 'light' : 'dark')}>Toggle Color Mode</button>
</div>
);
};
useWindowSize
The `useWindowSize` hook provides the current window size, which can be useful for responsive design and adapting your components based on the viewport dimensions.
import { useWindowSize } from '@docusaurus/theme-common';
const MyComponent = () => {
const windowSize = useWindowSize();
return <div>Window size: {windowSize.width} x {windowSize.height}</div>;
};
Gatsby themes allow you to share functionality across multiple Gatsby sites. Similar to @docusaurus/theme-common, Gatsby themes provide a way to encapsulate and reuse common components, hooks, and utilities. However, Gatsby themes are specific to the Gatsby ecosystem.
next-themes is a library for managing themes in Next.js applications. It provides similar functionality to @docusaurus/theme-common, such as theme configuration and color mode management, but is designed specifically for Next.js.
styled-components is a popular library for styling React applications using tagged template literals. While it doesn't provide theme-specific utilities like @docusaurus/theme-common, it offers powerful theming capabilities through its ThemeProvider component.
@docusaurus/theme-common
Common code for Docusaurus themes.
3.7.0 (2025-01-03)
docusaurus-faster
, docusaurus
docusaurus-plugin-content-blog
, docusaurus-theme-classic
create-docusaurus
, docusaurus-mdx-loader
, docusaurus-module-type-aliases
, docusaurus-plugin-client-redirects
, docusaurus-plugin-content-blog
, docusaurus-plugin-content-docs
, docusaurus-plugin-content-pages
, docusaurus-plugin-debug
, docusaurus-plugin-google-analytics
, docusaurus-plugin-google-gtag
, docusaurus-plugin-google-tag-manager
, docusaurus-plugin-ideal-image
, docusaurus-plugin-pwa
, docusaurus-plugin-rsdoctor
, docusaurus-plugin-sitemap
, docusaurus-plugin-svgr
, docusaurus-plugin-vercel-analytics
, docusaurus-preset-classic
, docusaurus-theme-classic
, docusaurus-theme-common
, docusaurus-theme-live-codeblock
, docusaurus-theme-mermaid
, docusaurus-theme-search-algolia
, docusaurus-types
, docusaurus
docusaurus-plugin-content-blog
docusaurus-module-type-aliases
, docusaurus-plugin-svgr
, docusaurus-preset-classic
, docusaurus-types
, docusaurus-utils
, docusaurus
docusaurus-remark-plugin-npm2yarn
docusaurus-theme-classic
, docusaurus-theme-common
docusaurus-bundler
, docusaurus-theme-common
docusaurus-theme-common
docusaurus-theme-translations
docusaurus-plugin-content-docs
docusaurus
docusaurus-mdx-loader
docusaurus-theme-search-algolia
docusaurus
create-docusaurus
, docusaurus-mdx-loader
, docusaurus-module-type-aliases
, docusaurus-plugin-content-blog
, docusaurus-plugin-content-docs
, docusaurus-plugin-content-pages
, docusaurus-plugin-debug
, docusaurus-plugin-ideal-image
, docusaurus-plugin-pwa
, docusaurus-theme-classic
, docusaurus-theme-common
, docusaurus-theme-live-codeblock
, docusaurus-theme-mermaid
, docusaurus-theme-search-algolia
, docusaurus-types
, docusaurus
docusaurus-theme-common
FAQs
Common code for Docusaurus themes.
We found that @docusaurus/theme-common demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.