[Define New Theme] 3. We need to use a pre-processor such as LESS or which ever is decided upon at least in development.

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The current feature release of phpBB 3 is 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
User avatar
hanakin
Front-End Dev Team Lead
Front-End Dev Team Lead
Posts: 968
Joined: Sat Dec 25, 2010 9:02 pm
Contact:

[Define New Theme] 3. We need to use a pre-processor such as LESS or which ever is decided upon at least in development.

Post by hanakin »

*Note This is part 3 of a series found here

As the topics suggests this is a discussion form for how weather and how to move forward with the concept of CSS variables

With the introduction of a possible new spec in some of the modern browsers in the works, and the rampant popularity of CSS preprocessors. It is almost certain that whomever works on the theme will most likely work in some sort of pre-processor initially, being that the power of variables, functions, & mixins just to name a few are so powerful leading to cleaner, smaller, and more organized codebase.

The end result is still CSS, however; we need to decide if thats is all that we maintain or do we maintain the for example LESS files as well weather it be included in the download or maintained separately in order to allow for better maintainability.

With this being said the real questions are:

Which pre-processor do we use or start in?
Should this be included in the repo in a separate directory outside of the phpbb as a tool or included with the theme it self?

My opinion is that it is a definite certainty that pre-processors be used, but when it comes to maintaining the theme I am drawn. I am not sure one-way or the other how best to maintain it. This is one of the many reasons why I feel that the theme should be its own project and stable versions merged prior to releases of PHPBB, but that is probably a separate topic of discussion.

Thoughts & Suggestions?
Donations welcome via Paypal Image

Frug
Registered User
Posts: 57
Joined: Thu Jul 02, 2009 3:33 am

Re: [Define New Theme] 3. We need to use a pre-processor such as LESS or which ever is decided upon at least in developm

Post by Frug »

Am I wrong in supposing this part of the project will be used by a small number of people, maybe even only the project lead? It wouldn't be strictly necessary to use it to contribute push requests or change requests, only whoever compiles it needs to really be familiar.

So with that assumption, let the lead pick the one he's most familiar with? Of course, I'm supposing there's a design lead an that he/she'll do the bulk of the core work.

User avatar
hanakin
Front-End Dev Team Lead
Front-End Dev Team Lead
Posts: 968
Joined: Sat Dec 25, 2010 9:02 pm
Contact:

Re: [Define New Theme] 3. We need to use a pre-processor such as LESS or which ever is decided upon at least in developm

Post by hanakin »

originally yes maybe, depending on how we decide to work it. But thats not really the only question as from a maintaining standpoint its still something we should manage with the theme which is where the real questions arise. Its easier to manage preprocessor files then css files as their is less to manage pun intended. Not unlike a framework specific to the default theme for phpbb. Which means it could potentially be ported easily enough into other preprocessors by individuals or the team for the future. The real goal is to make something that sort of stands the test of time across multiple development teams and iterations of the software.
Donations welcome via Paypal Image

User avatar
MattF
Extension Customisations
Extension Customisations
Posts: 675
Joined: Mon Mar 08, 2010 9:18 am

Re: [Define New Theme] 3. We need to use a pre-processor such as LESS or which ever is decided upon at least in developm

Post by MattF »

I think the benefit of LESS would be for style designers. Properly designed, it should greatly ease the customizing of the CSS variables.

LESS should not be compiled in the browser though. It should be compiled prior to packaging of the style, and the CSS should be served as regular CSS.
Has an irascible disposition.

User avatar
Meis2M
Registered User
Posts: 448
Joined: Fri Apr 23, 2010 10:18 am
Contact:

Re: [Define New Theme] 3. We need to use a pre-processor such as LESS or which ever is decided upon at least in developm

Post by Meis2M »

VSE congratulation .. you are now in MOD team of phpBB... plz invite me to your party :D

User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: [Define New Theme] 3. We need to use a pre-processor such as LESS or which ever is decided upon at least in developm

Post by brunoais »

If you think this is a "need", then I believe you are seriously wrong. Still, from your explanation, you seem to mention as a helper/tool instead of an actual requirement for the project. In that, I'm ok.
The main issue I have with the use of tools of any kind is that almost everybody around me follows this strictly:
if all you have is a hammer, everything looks like a nail
(it's been happening a lot recently in the web with the javascript boom and "javascript-only" pagesweb applications (which are actually nothing more than web pages, tbh)).

Now, after I explained where my point comes from, back to CSS reprocessor.
From the ones I tried (SASS, LESS, Stylus), LESS seems to be the best option. It is the one that seemed more of a superset than something that transforms language X into language Y (Y is CSS).

We now use synfony, so we probably won't need assetic as synfony seem to do its job well (this can help: https://gist.github.com/ollietb/3082684).

My main question is: How much will people view LESS as a super "hammer" and use it for all existing and inexistent "nails"?
LESS and SASS (I don't remember stylus) allow formatting and organizing the CSS in such way that it can become a small mess. I believe we definitely don't want that! The current CSS spec already allows messing up its organization into a complete mess.
While CSS can be a mess, with LESS or SASS it is a "can a mess" on steroids. So we need to be careful about the subset of what LESS does in order to stay organized in both input LESS/SASS and output CSS.

As for the voting, I vote yes. The things I like the most are the actual cascading/"namespacing" writting (nested rules), automatic prefixing and variables (allowing to define all the variable values on the top of the CSS file \o/) and I really wanted to see those in phpBB.


User avatar
Kamahl19
Registered User
Posts: 161
Joined: Thu Dec 27, 2007 10:31 am

Re: [Define New Theme] 3. We need to use a pre-processor such as LESS or which ever is decided upon at least in developm

Post by Kamahl19 »

I dont see how LESS code can become mess. It is the best way how to "unmess" messy CSS used in phpBB3

User avatar
hanakin
Front-End Dev Team Lead
Front-End Dev Team Lead
Posts: 968
Joined: Sat Dec 25, 2010 9:02 pm
Contact:

Re: [Define New Theme] 3. We need to use a pre-processor such as LESS or which ever is decided upon at least in developm

Post by hanakin »

VSE wrote:I think the benefit of LESS would be for style designers. Properly designed, it should greatly ease the customizing of the CSS variables.

LESS should not be compiled in the browser though. It should be compiled prior to packaging of the style, and the CSS should be served as regular CSS.
Totally agree but minified and compressed CSS :D !

I would like to see separation a less directory and a css directory built from it. css should live in three or four files however.

Global <- reset & base styles
Core <- set the styles required for barebones. defaults for type, forms, tabels, etc..., none component stuff as well as any helper classes
Components <- this is where all the components live
Theme <- Possible fourth file to catch any outliers that do not fit in one of the categories or need cleaned up in the future

then these would get merged at render into a cached style.css file

*VSE also congrats on the purple status ;)
PayBas wrote:Let's just wait for CSS vars :P
https://developer.mozilla.org/en-US/doc ... _variables
Yes mozilla has announced it but none of the others have as of yet so who knows when it will be mainstream. And we can always convert preprocessor vars into css vars. This still does not allow for mixins which is extremely useful as well in maintain the reuse of code.
Donations welcome via Paypal Image

User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: [Define New Theme] 3. We need to use a pre-processor such as LESS or which ever is decided upon at least in developm

Post by EXreaction »

LESS is definitely helpful from my experience, I wouldn't want to make major project with a lot of CSS without it.

Post Reply