Reference › Project
clarusjs 0.7.0
All releases · [email protected] on npm
Minor Changes
- Stylesheet imports and per-page CSS:
@import './x.css'(no name) in a page or component declares a stylesheet it needs. Each goes through Vite's CSS pipeline (PostCSS or Lightning CSS, minified and hashed), and each page links exactly the stylesheets it imports directly or through its components, dependencies first, before the component styles. Client-route shells link every client page's stylesheets; fragments carry their page's links, and fragment navigation adds and waits for any that are missing. The client router now keeps the head across navigations (it updates the title and<html>attributes and runs the new page's inline head scripts), so linked stylesheets stay. #130 <script inline>: a script written into the page as is (static attributes only; its content is never a template) and run where it stands, such as at the top of<head>to apply a saved theme before the first paint. The client router now runs the rendered page's inline head scripts, as a normal load would, and the island style is installed on the document by the loader so it survives head swaps. #130- Build-time link checking: once every page is built, links to pages and files that don't exist fail the build, and links to a missing
#anchorwarn, each with the source file and line and a "did you mean" suggestion. Configure withlinks: { pages, anchors, strict }(error,warnoroff). #139 - Page sources:
clarusjs({ sources: [...] })lets a plugin turn files with another extension (such as.mdfrom@clarusjs/content) into.tscltext, compiled like any page: routes, layouts, components, styles, islands and the manifest all apply. Only files undersrc/are claimed, never?raw/?urlimports. #135 <style>in.tsclfiles. A top-level<style>is the component's stylesheet, scoped with native@scope: the component's top-level elements getdata-cl-c="<id>", rules apply inside them (style the top-level element itself with:scope) and stop at other components.<style global>is left unscoped. Every component's styles are bundled into one stylesheet (minified and hashed by Vite) that every page links; in dev it is regenerated when a.tsclfile changes.{{ }}holes in a component<style>are a located build error: pass values as CSS custom properties. #130
Patch Changes
- The documentation lives at https://clarusjs.com: package homepages and READMEs point there. #140
- Page sources get
rootandaddDependency(file)in their context (files they read are watched in dev), and only apply undersrc/pages: a source-extension file elsewhere (such as a Markdown part to include) is not a page or a component. #138