Site Theme275 Documents

Component Reuse

Before creating UI in a site or theme, search site core at ~/site, the relevant part sites at ~/partName/site and the owning site or theme for reusable components. Reuse a component when it provides the intended structure and behavior. Put missing domain UI in its part site and site- or theme-specific UI in its owner. Site core may provide reusable domain-neutral components that render semantic HTML through JSX, together with shared behavior and accessibility. Part sites provide reusable domain components through the same headless JSX approach. Neither site core nor part-site components may define or import component appearance styles; the consuming site or theme supplies appearance through semantic classes. Core build infrastructure CSS remains permitted. Extend an existing component additively when that preserves its contract and behavior for dependent sites and themes. If it cannot support the intended result through such an extension, first add an explanation to a file named warning at the root of the site or theme. Name the component that cannot be reused and state the exact intended structure or behavior and why an additive extension cannot provide it. Then create a local component for that purpose. Keep theme appearance in theme styles.