Semantic structure
Use the documented Xshna classes with semantic HTML rather than replacing native elements unnecessarily.
Compose existing xsh- classes on the appropriate HTML element. Keep content order meaningful when CSS is disabled.
Document natural Tab order, focus-visible styles, Escape dismissal and roving focus for custom composite widgets.
The following semantic HTML uses shipped class names. Interactive application behavior, when required, is provided by the optional JavaScript layer or your application.
<div class="xsh-app"><button class="xsh-btn xsh-btn-primary">First action</button><button class="xsh-btn xsh-btn-ghost">Second action</button></div>Place dist/xshna.min.css in your site's assets directory. For declarative interactive components, also load dist/xshna.min.js with defer. Individual icon assets are available as SVG files in dist/icons/svg/. Copy the files you use, or deploy the complete icon directory. No Node.js is required on the hosting server.
Relevant names or configuration points for this pattern are documented below. Names are composable; not every combination implies a distinct behavior.
| Selector, attribute or file | Role |
|---|---|
tabindex | Configuration or reusable building block |
:focus-visible | Configuration or reusable building block |
aria-expanded | Configuration or reusable building block |
Prefer intrinsic sizing, grid or flexible wrapping. Test minimum viewport widths of 320px, 375px and 768px, and narrow component containers. Long labels must wrap or be truncated intentionally without making essential content unavailable.
For stateful controls, apply the correct native disabled, required, checked or aria attributes. States must be conveyed in text or accessible names, rather than by color alone. Avoid nesting interactive elements inside interactive controls.
Use the native semantic HTML element first: a button for an action, a link for navigation, a label associated with each input and a real table for tabular data. Keyboard interaction should preserve visible focus and predictable Tab order. Inspect the rendered UI with actual assistive technology before certifying accessibility.
Apply data-xsh-theme for light/dark/high-contrast themes, data-xsh-design for a Design DNA personality and data-xsh-density for comfortable or dense presentations. Prefer logical properties so the pattern works when the document direction changes.
Respect prefers-reduced-motion and provide a static presentation for content that would otherwise depend on animation. A personality is a coordinated visual preset, not a guarantee that arbitrary custom colors satisfy WCAG contrast requirements.
This pattern is built from static classes. Use Xshna Extract for application-specific CSS reduction, or ship the complete distribution when simplicity matters more than transfer size. Application data, authentication and persistence remain the responsibility of your application.
If styles are missing, confirm that the CSS URL resolves and the root has class="xsh-app". For missing icons, verify that the self-hosted SVG files exist under dist/icons/svg/ and that image paths resolve correctly. If a dynamic class disappears after extraction, add the class to the Extract safelist and regenerate the bundle.
This reference applies to Xshna.css 1.0.0-beta.2. Beta APIs may change. See the accompanying release notes and test report for verified browser coverage and known limitations.
| Surface | Source of truth | What to check |
|---|---|---|
dist/xshna.min.css | Compiled framework | Styling and responsive behavior |
dist/xshna.min.js | Optional interactions | Lifecycle, event handling and teardown |
src/css/ | Readable source | Public class names and token definitions |
src/contracts/ | Published component contracts where available | State, configuration and behavioral support |
Use the documented Xshna classes with semantic HTML rather than replacing native elements unnecessarily.
Compose existing xsh- classes on the appropriate HTML element. Keep content order meaningful when CSS is disabled.
Verify focus order, disabled behavior and descriptive labels for interactive patterns.
Load xshna.min.js only if the documented interaction needs it. Your application remains responsible for data, persistence and business rules.
Test narrow containers, long translations and user-defined text sizes.
Test 320px-wide viewports, container-constrained instances, keyboard zoom, longer translations and right-to-left text where relevant.
Use --xsh-* CSS variables for theme values and data-xsh-design / data-xsh-density on the xsh-app root.
Prefer design tokens over hard-coded overrides so components remain coherent across personalities.