Skip to content

Issue/182 replace ruby sass with dartsass#183

Merged
jonrandahl merged 16 commits intodevfrom
issue/182-replace-ruby-sass-with-dartsass
Jan 15, 2026
Merged

Issue/182 replace ruby sass with dartsass#183
jonrandahl merged 16 commits intodevfrom
issue/182-replace-ruby-sass-with-dartsass

Conversation

@jonrandahl
Copy link
Contributor

Summary

Replaced deprecated sass-rails gem with Dart Sass and updated styling for Bootstrap 5 compatibility.

Specific to ticket #182

Changes

  • Replaced sass-rails with dartsass-sprockets for Dart Sass compatibility
  • Updated lr_common_styles gem (includes Bootstrap 5)
  • Enabled Sass source maps for front-end debugging
  • Added Autoprefixer with source map generation
  • Modernised stylesheets with Bootstrap conventions
  • Improved Sentry initialisation with better environment control
  • Streamlined Makefile for improved development workflow

Breaking Changes

None

Checklist

Testing

  • Manual testing completed
  • No regressions introduced

Build & Assets

  • Assets compile successfully
  • Linting passes (rubocop, eslint)
  • Docker image builds successfully

Process & Quality

  • Changelog updated

- Modifies Bundler to specify the default group and Rails environment.
- Suppresses SASS deprecation warnings from dependencies to maintain a clean console output. This ensures developers are not distracted by warnings that do not require immediate action.
- Silences `@import` deprecation warnings during the migration to `@use` and `@forward`, providing a smoother transition.
- Adds the `services` directory to the autoload paths, enabling easy access to service classes throughout the application.
- Monkey-patches Rails to output start-up log messages in JSON format for better integration with combined logging services. This allows for standardised and parsable log entries.

Related to #182
- Updates the project to use Dart Sass instead of Ruby Sass.
- This change modernises the Sass compilation process and improves compatibility with newer front-end tools.
- Removes the deprecated `sass-rails` gem and introduces `dartsass-sprockets`.
- Updates `lr_common_styles` to Bootstrap 5, aligning with current standards.
- Includes necessary updates for related gems like `autoprefixer-rails`.
- Removes redundant gems to streamline the project's dependencies.
- Adds `htmlbeautifier` gem for development, which helps maintain consistent code style.
- Updates `faraday` gem version.
- Moves `stackprof` gem declaration before `sentry-rails`
- Groups `sdoc` gem declaration inside `:doc`

Relates to #182
- Configures Autoprefixer to generate source maps for easier debugging of CSS.
- Registers a custom processor for Autoprefixer that includes source map generation.
- Updates the asset configuration to use the custom Autoprefixer processor.

Relates to #182
- Enables SASS source maps in development for easier debugging, allowing developers to trace styles back to their origin in the source code.
- Sets SASS output style to compressed in production for smaller file sizes, improving website performance.
- Updates the Makefile to streamline development processes and improve maintainability.
- Updates the .gitignore file to exclude local TODO files and wget logs.
- Configures the asset pipeline to use the correct dependencies and stylesheets.
- Replaces the old application.scss with a new one, including necessary imports like govuk-template, bootstrap, font-awesome, and leaflet.
- Includes popper.js in the application javascript file for enhanced Bootstrap functionality.
- Updates Sentry initialisation for clarity and flexibility.
- Allows disabling Sentry in specific environments by unsetting the API key, providing better control over error reporting.
- Updates the Sentry environment configuration to use the instance configuration value to align with deployment practices.
- Replaces `config.logger.level` with `config.sdk_logger.level` to correctly configure the SDK logger level and filter error reporting effectively.
- Documents the purpose of sample rates and environment variables.
- Standardises variable naming.
- Updates the report detail toggle text for clarity and by making the toggle more descriptive.
- Removes unnecessary clearfix divs from view templates.
- Ensures consistent styling across different screen sizes by adjusting offsets.
- Adds padding to the help link for improved visual spacing.
- This change enhances the user interface by providing a more visually appealing layout.
- Removes the erroneous class promoting consistency across the application.
- Modifies CSS classes to follow new Bootstrap conventions
- Updates font size and spacing for enhanced readability.

Refs: #182
- introduces root variables for consistent styling
- improves form control layout and appearance
- enhances button styles for better user experience
- uses variables for font sizes and colours.
- bumps the minor version to reflect feature enhancements
- resets the patch version to zero for a new release cycle
- replaces `sass-rails` with `dartsass-sprockets`
- uses Dart Sass for improved compatibility
- enables Sass source maps for front-end debugging
- adds Autoprefixer for CSS debugging
- configures Sass compression in production
@jonrandahl jonrandahl self-assigned this Jan 15, 2026
Copy link
Contributor

@joescottdave joescottdave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jonrandahl jonrandahl merged commit 46f1880 into dev Jan 15, 2026
2 checks passed
@jonrandahl jonrandahl deleted the issue/182-replace-ruby-sass-with-dartsass branch January 15, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants