// No styles applied!
// No styles applied!
This is a common mistake when following general web conventions where
BEM uses kebab-case. In RSX, component class names are PascalCase,
so BEM children must also be PascalCase.
NO EXEMPTIONS
There are NO exemptions to this rule for files in rsx/app/ or
rsx/theme/components/. Every SCSS file in these directories must
be scoped to its associated action, layout, component, or view.
If a file cannot be associated with any of these (extremely rare),
it likely belongs elsewhere:
- rsx/theme/base/ for global utilities and variables
- rsx/theme/layouts/ for shared layout styles
- A dedicated partial imported via @use
Moving files outside the enforced directories requires explicit
developer approval and should be carefully considered. In 99% of
cases, the SCSS file should be properly scoped.
VALIDATION
The scoping rule is enforced at manifest build time. Violations
produce errors like:
SCSS file 'rsx/app/frontend/dashboard/dashboard.scss' must be
fully enclosed in a single class rule matching a Component
or Blade @rsx_id.
Expected: .Dashboard_Index_Action { ... }
Found: No wrapper class detected
Or for wrapper class mismatches:
SCSS wrapper class 'Frontend_Dashboard' does not match any
Component class or Blade @rsx_id
Or for filename mismatches:
SCSS filename 'styles.scss' must match associated Component
file 'dashboard_index_action'
EXAMPLES
Correct - SPA Action Styles:
// rsx/app/frontend/invoices/invoices_view_action.scss
.Invoices_View_Action {
.invoice-header {
display: flex;
justify-content: space-between;
}
.line-items {
.item-row {
border-bottom: 1px solid #eee;
}
}
@media (max-width: 768px) {
.invoice-header {
flex-direction: column;
}
}
}
Correct - Layout with Variables:
// rsx/app/frontend/frontend_spa_layout.scss
$sidebar-width: 215px;
$header-height: 57px;
.Frontend_Spa_Layout {
.app-sidebar {
width: $sidebar-width;
position: fixed;
}
.app-header {
height: $header-height;
}
}
Correct - Component Styles:
// rsx/theme/components/modal/rsx_modal.scss
.Rsx_Modal {
.modal-header {
border-bottom: 1px solid var(--border-color);
}
.modal-body {
padding: 1.5rem;
}
&.modal-lg {
.modal-dialog {
max-width: 800px;
}
}
}
Incorrect - Multiple Top-Level Rules:
// BAD: Multiple selectors at top level
.Dashboard_Index_Action {
.card { ... }
}
.sidebar { // ERROR: This is outside the wrapper
width: 200px;
}
Incorrect - No Wrapper:
// BAD: No wrapper class
.card {
padding: 1rem;
}
.stats-grid {
display: grid;
}
SEE ALSO
spa - SPA routing and actions
jqhtml - Component template system
coding_standards - General naming conventions
code_quality - Code quality rule system