jaspr-styling
Installation
SKILL.md
Rules for Styling
Jaspr provides a native, type-safe CSS-in-Dart styling API via the Styles class.
1. Component-Level Styles (@css annotation)
The recommended approach for defining styles in Jaspr is inside your components to ensure better code locality.
- Rule 1: You MUST use the
@cssannotation on a static getter returningList<StyleRule>to scope styles to a component. - Rule 2: You MUST use specific CSS selectors (like
.mainclasses or#idids) withincss()to prevent your styles from bleeding into other components, as@cssstyles are globalized during rendering.
class App extends StatelessComponent {
const App({super.key});