Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize stylesheet entry points #2

Merged
merged 1 commit into from
Jan 22, 2022

Conversation

jmckible
Copy link
Contributor

In order to support additional stylesheets or non-standard naming, this change will expose the build path via a configuration hash. I've started with a pattern of:

config.dartsass.stylesheets = { 'application.scss' => 'appliction.css' }

In actual code, this ends up looking like this in our application:

# config/initializers/dartsass.rb
Rails.application.config.dartsass.stylesheets = {
  'app/index.sass'   => 'app.css',
  'embed/index.sass' => 'embed.css',
  'site/index.sass'  => 'site.css'
}

I'm open to a different convention. I could see using more implicit magic (extracting the output naming from the input file (or directory, in the case of index.sass/scss). But I don't have a sense of where this is aiming (perhaps some coupling with propshaft?), so this felt like the simplest option.

Expose Rails.application.config.dartsass.stylesheets as a configuration hash of entry points and built stylesheets.
@dhh dhh merged commit 8196032 into rails:main Jan 22, 2022
@dhh
Copy link
Member

dhh commented Jan 22, 2022

I think this is good 👍. Although. Might want to consider renaming the config variable.

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