Opened 3 years ago

Last modified 3 years ago

#11463 new enhancement

Runtime support for pre-processor stylesheets

Reported by: lkraav Owned by: Olemis Lang
Priority: normal Component: ThemeEnginePlugin
Severity: normal Keywords: css, less, sass, scss
Cc: Trac Release:

Description (last modified by lkraav)

Pre-processor advantages are probably obvious for everyone.

Idea is for the plugin to automatically compile and cache all enqueued pre-processor stylesheets, like LESS or SCSS, determined by the file name extension.

I'm familiar with only LESS for now, so that's my own contribution goal.

I would be modeling the solution after this well working WP-LESS plugin from WordPress world.

Problem spot might be finding a Python LESS compiler of adequate quality. Pointers welcome.

Leave a comment if you're interested in having such a tool.

Rationale for including this in ThemeEnginePlugin: seems like a natural fit. Trac developer resources are scarce, so I'd rather avoid fragmentation.

Attachments (0)

Change History (6)

comment:1 Changed 3 years ago by lkraav

Description: modified (diff)

Explain integration

comment:2 Changed 3 years ago by Ryan J Ollos

Is trac:#10672 asking for the same thing? I think we can work on getting that ticket into the Trac core in one of the next major releases.

comment:3 Changed 3 years ago by lkraav

Hmm, it's at least related, possibly in the early request plumbing part. But in the interest of keeping scope reasonable for both, it is likely not be a good idea to combine these into one effort. I think "feature as a plugin" start is better here to see how it all works out. Based on my WP experience, solid dep. min. functionality is not trivial to code at all.

comment:4 Changed 3 years ago by Olemis Lang

Keywords: css less sass scss added

I'll start working on this one without accepting ticket , see #11457

I'll add interfaces to plug the css pre processor of choice by a given theme (e.g. sass, scss , ... , less) and will definitely incorporate default implementation for the later (since it's used by Bloodhound theme powered by Bootstrap) .

Initially only TRAC_ADMIN users will be able to configure such aspects (see #6433). This feature will be available then should a third party component implement the appropriate interface to support a given syntax . Only a single (theme-specific) css file will be compiled this way e.g. bootstrap.css

I plan to support customization of the following aspects :

  • variables
  • mixins

Compilation process will actually happen in the server side, therefore a python compiler is needed.

@lkraav : please mention if the aspects mentioned above are ok for you.

OTOH could you please choose one of these libs ?

It'd be nice if you could provide sample code that you'd prefer to achieve best possible generation.

TBH I've found more robust py libs for sass than I did for less e.g.

comment:5 Changed 3 years ago by lkraav

Your plan seems solid. gives me confidence in the first option. Repo is active and moving forward. Now Python 3 vs 2 may become an issue?

metalshark's stuff seems hopeLESSly outdated.

comment:6 Changed 3 years ago by Olemis Lang

ok , I'll try to get something done with it once target pull request will be merged upstream . /me subscribing to that thread , thnx .

Modify Ticket

Change Properties
Set your email in Preferences
as new The owner will remain Olemis Lang.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.