getnikola / plugins

Extra plugins for Nikola
https://plugins.getnikola.com/
MIT License
59 stars 95 forks source link

[sass] Canonical way to generate the ".min.css" file? #330

Open KelSolaar opened 4 years ago

KelSolaar commented 4 years ago

Hi,

I'm trying the sass plugin with bootstrap Scss files and I would like to what it the canonical way to generate the bootstrap.min.css file if any.

In my targets file, I can put bootstrap.scss and it generates correctly assets/css/bootstrap.css, however, I cannot use bootstrap.min.css:

(colour-science.org-USMIstgQ-py3.7) Kali:colour-science.org kelsolaar$ nikola build
Scanning posts..........done!
ERROR: Two different tasks can't have a common target.'output/assets/css/bootstrap.min.css' is a target for copy_assets:output/assets/css/bootstrap.min.css and build_sass:output/assets/css/bootstrap.min.css.

Cheers,

Thomas

ralsina commented 4 years ago

No canonical way, usually the upstream provides it.

Just use whatever minimizer you like :-)

On Sat, Apr 18, 2020 at 10:44 PM Thomas Mansencal notifications@github.com wrote:

Hi,

I'm trying the sass plugin with bootstrap Scss files and I would like to what it the canonical way to generate the bootstrap.min.css file if any.

In my targets file, I can put bootstrap.scss and it generates correctly assets/css/bootstrap.css, however, I cannot use bootstrap.min.css:

(colour-science.org-USMIstgQ-py3.7) Kali:colour-science.org kelsolaar$ nikola build Scanning posts..........done! ERROR: Two different tasks can't have a common target.'output/assets/css/bootstrap.min.css' is a target for copy_assets:output/assets/css/bootstrap.min.css and build_sass:output/assets/css/bootstrap.min.css.

Cheers,

Thomas

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/getnikola/plugins/issues/330, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAAMKYH27ZSF4IPOOWIHJDRNJJNNANCNFSM4MLS2MPA .

KelSolaar commented 4 years ago

All good and thanks Roberto! I was just checking in case I was missing something obvious!

Kwpolska commented 4 years ago

Just sass isn’t enough to build Bootstrap, by the way. I built my Bootstrap pipeline outside of Nikola, you can steal the Node script for the second step if you want.

KelSolaar commented 4 years ago

To generate the css files, I only needed sass and the scss directory.

Kwpolska commented 4 years ago

Yes, but those files are not fully compatible with all browsers. The missing step is running autoprefixer.

KelSolaar commented 4 years ago

Good to know, given everything seeming LGTM on Chrome, Firefox, Safari and IE, I don't think I will bother introducing an extra step.