style_capsule 1.2.0
Provides component-scoped CSS encapsulation using [data-capsule] attributes for Phlex components, ViewComponent components, and ERB templates. Styles are automatically scoped to prevent leakage between components. Inspired by component-based CSS approaches like Angular's view encapsulation and CSS modules. Works with Rails and can be used standalone in other Ruby frameworks (Sinatra, Hanami, etc.) or plain Ruby scripts.
Gemfile:
=
install:
=
Versions:
- 1.2.0 November 24, 2025 (35.5 KB)
- 1.1.0 November 21, 2025 (34.5 KB)
- 1.0.2 November 21, 2025 (31.5 KB)
Development Dependencies (16):
activesupport
>= 6.0, < 9.0
appraisal
~> 2
memory_profiler
~> 1
phlex-rails
~> 2.0
railties
>= 6.0, < 9.0
rake
~> 13
rbs
~> 3
rspec
~> 3
rspec_junit_formatter
~> 0.6
simplecov
~> 0.22
simplecov-cobertura
~> 3
standard
~> 1
standard-performance
~> 1
standard-rails
~> 1
view_component
~> 4.0
webmock
~> 3