Skip to main content

The SASS Infrastructure

Much of the CSS in this gem is written in SASS, an extension language for CSS. This means that your application can also write its CSS in SASS.

The actual SASS files (whether in .sass or .scss files) is transpiled to CSS via the Ruby sass implementation. Note, however, that this is not the most commonly used transpiler; the C/C++ implementation, libsass is the standard implementation of the SASS spec. This means that there are certain features of the most recent versions of SASS that aren't implemented in the Ruby transpiler yet. The most important such feature is the ability to use the @import directive to include regular CSS files into your SASS manifest. This gem relies on external CSS dependencies and uses this feature. While not implemented in the basic Ruby SASS gem, this feature is enabled by the sass-rails gem. This gem properly ties together SASS and the Sprockets-based Rails asset pipeline. The precise nature of this infrastructure is important because if you are trying to use PMACS Frontend in a Rails Engine, you will need to ensure that sass-rails is being required, or else you will get an error that some external dependency (like jquery-ui/core) cannot be found.

PMACS Frontend and Bootstrap styles are loaded via SASS and thus support intelligent overrides and easy extension. Anything you @import before pmacs-frontend (which itself imports Bootstrap) will override or extend these styles. For further examples, please refer to this page.