Bug 125696 - Introduce CSS preprocessor
Summary: Introduce CSS preprocessor
Status: NEW
Alias: None
Product: LibreOffice Online
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyInteresting, easyHack, skillJavaScript, topicWeb
Depends on:
Blocks:
 
Reported: 2019-06-05 08:39 UTC by Samuel Mehrbrodt (allotropia)
Modified: 2020-05-19 11:22 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Mehrbrodt (allotropia) 2019-06-05 08:39:46 UTC
I suggest we should use a CSS preprocessor for the css in loleaflet.
It has many advantages over pure CSS (variables, inheritance, etc; see https://raygun.com/blog/10-reasons-css-preprocessor/ e.g.).

Not sure which is the best.
I would probably go with LESS ( http://lesscss.org/ ) since it works with Node.js (while SASS ( https://sass-lang.com/ ) for example requires Ruby runtime).

Any opinions on this?
Comment 1 Alexandru Vladutu 2019-06-05 09:18:17 UTC
Sass seems to be the most popular option though, and we can use https://github.com/sass/node-sass without having to require Ruby fortunately.
Comment 2 Samuel Mehrbrodt (allotropia) 2019-06-05 09:20:33 UTC
(In reply to Alexandru Vladutu from comment #1)
> Sass seems to be the most popular option though, and we can use
> https://github.com/sass/node-sass without having to require Ruby fortunately.

Ah good to know.

Despite popularity, are there any important advantages SASS has over LESS?
LESS has the advantage that it's backwards-compatible with CSS, so we could gradually introduce it without converting all CSS in one shot.
Comment 3 Alexandru Vladutu 2019-06-05 09:40:15 UTC
If I'm not mistaken if you use .scss (which is more common) the same can be said for SASS. 

Personally I don't think there's much difference between SASS, Less or even Stylus. All have the most important features that people commonly use.
Comment 4 Samuel Mehrbrodt (allotropia) 2019-06-05 10:28:00 UTC
So probably whoever does the work should decide which one to use.
Comment 5 Buovjaga 2019-08-22 17:13:44 UTC
I don't think there is much need for a preprocessor nowadays. Responding to some points in the raygun.com blog:

1. https://caniuse.com/#feat=css-variables

2. @import causing multiple requests is a non-problem in the age of HTTP/2: https://discourse.wicg.io/t/is-css-import-still-considered-as-an-anti-pattern/1967/5

3. Whole article in general, but as a comment to mixins: https://cathydutton.co.uk/posts/why-i-stopped-using-sass/
"CSS custom properties can do more than just replace pre processor variables, they have the added bonus of being updated dynamically (instead of compiled at build). This allows values to be altered at run time with Javascript and to be scoped without the need for mixins and functions to outwit the cascade."

5. https://caniuse.com/#feat=calc

Postprocessing [1] might be more useful, but it is always a danger to introduce more moving parts and complicate the build process.

[1] https://postcss.org/