Skip to content

Commit

Permalink
doc: Update doc comments for better clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank1513 committed Jun 27, 2024
1 parent 3c78884 commit eedf0eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/src/client/switcher/switcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ const modifyTransition = (themeTransition = "none") => {
};

/**
* The Core component applies classes and transitions without injecting any scripts. Use ThemeSwitcher only once per page. For scoped styles, use this component instead.
*
* Please note that you need to use suitable techniques to increase specificity of CSS selecors when using data- attributes for targetting a container which is within another themed container (including the html if you have used ThemeSwitcher without targetSelector)
*
* @example
* ```tsx
* <Switcher />
* <Switcher targetSelector="#container1" />
* ```
*/
export /** Root switcher */
const Switcher = ({
export const Switcher = ({
forcedTheme,
forcedColorScheme,
targetSelector,
Expand Down
4 changes: 3 additions & 1 deletion lib/src/client/theme-switcher/theme-switcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ const Script = ({
};

/**
* The Core component wich applies classes and transitions.
* The Core component wich applies classes and transitions. Use this only once on a layout.
*
* For contained themes you may use Switcher from `nextjs-themes/client/switcher`
*
* @example
* ```tsx
Expand Down

0 comments on commit eedf0eb

Please sign in to comment.