diff --git a/.github/workflows/validate-docs.yml b/.github/workflows/validate-docs.yml index a077ff1..d3e8b40 100644 --- a/.github/workflows/validate-docs.yml +++ b/.github/workflows/validate-docs.yml @@ -17,6 +17,9 @@ jobs: - name: Validate docs.json is valid JSON run: jq empty docs.json + - name: Validate snippet theme defaults + run: node scripts/check-snippet-theme-default.mjs + - name: Verify all referenced pages exist run: | set -euo pipefail diff --git a/AGENTS.md b/AGENTS.md index fcd1263..e1d089e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -33,6 +33,14 @@ - Use `` / `` for parallel code samples (hardhat vs. foundry, ethers vs. viem, etc.) - Always give `` blocks explicit language tags +## Mintlify JSX styling + +- In `snippets/*.jsx` and rendered JSX in `.mdx` pages, write Tailwind utility lists as literal attributes. Prefer `className="..."`; static string and template expressions without interpolation are also extractor-safe. +- Do not store utility lists in variables or assemble `className` dynamically. For conditional styling, use explicit JSX branches, inline styles, or a semantic data/class hook backed by `style.css`. +- A component may forward the exact `className` prop when it destructures `className` in its parameters and every caller supplies a literal utility list. +- Theme-aware snippets must seed hydration from `docs.json` `appearance.default` and synchronize the DOM theme in `useLayoutEffect`. +- Run `node scripts/check-snippet-theme-default.mjs` after editing a theme-aware snippet. + ## Content boundaries - Cosmos-SDK content is deprecated (see SIP-3) — keep the deprecation notice visible on `cosmos-sdk/index.mdx` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e124b99..78b29e5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,3 +30,9 @@ See the [README](README.md) for more details on local setup. - **Lead with the goal**: Start instructions with what the user wants to accomplish - **Use consistent terminology**: Don't alternate between synonyms for the same concept - **Include examples**: Show, don't just tell + +## JSX styling + +Mintlify only generates Tailwind utilities it can extract from JSX. In `snippets/*.jsx` and rendered JSX in `.mdx` pages, keep class lists in literal attributes. Prefer `className="..."`; static string and template expressions without interpolation are also safe. Do not keep utility lists in variables or assemble `className` dynamically. Use explicit JSX branches, inline styles, or a semantic hook in `style.css` for conditional styles. + +For theme-aware snippets, run `node scripts/check-snippet-theme-default.mjs`. diff --git a/evm/in-app-swaps.mdx b/evm/in-app-swaps.mdx index 5ce06b0..1498e25 100644 --- a/evm/in-app-swaps.mdx +++ b/evm/in-app-swaps.mdx @@ -4,6 +4,8 @@ sidebarTitle: 'In-App Swaps' description: 'Guide to integrating the Symphony swap widget into your Sei application for seamless token exchanges.' keywords: ['swap widget', 'in-app swaps', 'token exchange', 'dex integration', 'symphony'] --- +import { ThemeAwareIframe } from '/snippets/theme-aware-iframe.jsx'; + Integrating in-app swap functionality into your Sei application enables users to exchange tokens directly within your platform, enhancing user experience and engagement. ## Overview @@ -28,7 +30,7 @@ Swap widgets are embeddable UI components that abstract the complexity of intera ### Live Demo
-