Plots2: Minify css using yui or sass-rails

Created on 8 May 2020  路  7Comments  路  Source: publiclab/plots2

Currently the minify css setting is not set in production.rb file. While the sass-rails gem is present in the gemfile but it is not configured.

Please describe the desired behavior.
Css minifcation can be achieved by configuring sass-rails by setting it in production.rb. But apart from this all the css files mentioned in the application.css manifest file have to be replaced with @import statements following sass syntax.Also they have to be renamed with the extension .css.scss.

Another quick fix without using sass would be using the yui-rails compressor which would just require setting it in the production.rb file.

I personally vouch for the sass-rails gem since in the long run moving towards sass is a better option. But this will require some testing and documentation to assure contributors ahead follow the standards too.

Additional context (optional)
The setting has to be done in the production.rb file as-

image

The yui rails gem is available here
From the sass rails gem as we can see here the manifest file needs to be updated with @import statements.
image

discussion feature outreachy

All 7 comments

@jywarren @emilyashley @cesswairimu what should we go for? yui or sassc-rails :sweat_smile:

@Tlazypanda there could be a possibility the production.rb that we have on the repo is not the one configured on the production droplet.. I think @jywarren and @icarito would be at a better place to confirm what we are using in production and also give thoughts on this. Thanks for opening this

@cesswairimu Ohh yes :sweat_smile: Just checked the coverage tools on chrom dev tools the css files served do seem to be minified I guess the production.rb file must be having some setting already doing that ..

I think we are using the same production.rb file... I would guess with sass? But i haven't touched these settings for a long time.

You should be able to push to the publiclab unstable branch in this repo and auto-rebuild our unstable testing server with your code, to try things out. You'll see it building here: https://jenkins.laboratoriopublico.org/ and can view it at https://unstable.publiclab.org -- and it just overwrites what's at that branch. unstable is a throw-away test server so you don't have to worry too much about it :-)

Just ping in the chatroom that you're using it as we only have one, so it can get confusing if others are using it at the same time!

Ohh thanks @jywarren !! :tada: Will give it a try :v: So should we after testing out our changes revert the changes too?

@jywarren The css files seem to be already minified :sweat_smile:

OK, i'll close this up now! Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bronwen9 picture bronwen9  路  3Comments

grvsachdeva picture grvsachdeva  路  3Comments

grvsachdeva picture grvsachdeva  路  3Comments

keshavsethi picture keshavsethi  路  3Comments

keshavsethi picture keshavsethi  路  3Comments