plugins icon indicating copy to clipboard operation
plugins copied to clipboard

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

Open KelSolaar opened this issue 5 years ago • 6 comments

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

KelSolaar avatar Apr 19 '20 01:04 KelSolaar

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 [email protected] 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 .

ralsina avatar Apr 19 '20 01:04 ralsina

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

KelSolaar avatar Apr 19 '20 03:04 KelSolaar

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.

Kwpolska avatar Apr 19 '20 10:04 Kwpolska

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

KelSolaar avatar Apr 19 '20 19:04 KelSolaar

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

Kwpolska avatar Apr 19 '20 20:04 Kwpolska

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

KelSolaar avatar Apr 19 '20 21:04 KelSolaar