Skip to main content
Topic: SASS or LESS may be an option? (Read 5709 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

SASS or LESS may be an option?

I was thinking... would the use of SASS or LESS (One against the other) "at some point" be of interest?

The reasoning behind the proposal is that even though CSS are easy (who the heck said that?), we have some 6/8000 lines of them around, so quite difficult to dig into for anyone apart Ant (and likely Bloc).
Have some kind of "aggregation" of things may help simplify the editing of the theme as a whole, for example change color would not be a hide-and-seek game, but just a "chage-this-few-numbers-here". And so on.

In order to have that, though, we'd need a pure php compiler (there are some) bundled with Elk, and also a way to compile the code when needed.

What do you think? O:-)
Bugs creator.
Features destroyer.
Template killer.

Re: SASS or LESS may be an option?

Reply #1

For a css freak like me anything related to it is just more powa ;D
~ SimplePortal Support Team ~

Re: SASS or LESS may be an option?

Reply #2

I think could be useful for css geeks ;)
I'm not an expert, but I've used with success a joomla template with LESS. It took me some time to understand how it works but in the end the result was good enough for me.
sorry for my bad english

Re: SASS or LESS may be an option?

Reply #3

It could discourage developers to create new Themes. And it could the professionals developer create the Themes for money.



Regards Stephan

Re: SASS or LESS may be an option?

Reply #4

How would it discourage theme creation? If anything, it makes it much easier and faster.

Re: SASS or LESS may be an option?

Reply #5

Yep, unless you bring it to the extreme, as google "suggests", by stripping every block on a single line, regardless of how many selectors it has ;D
P.S.: welcome wintstar!
~ SimplePortal Support Team ~

Re: SASS or LESS may be an option?

Reply #6

Quote from: wintstar – It could discourage developers to create new Themes.
Yes and maybe no.
Yes, SASS and LESS are complex beasts, more than CSS alone of course, so it may be people get scared and run for their life. xD
Maybe no, 90% of people are just changing colors, and hopefully change colors with SASS and LESS should be much, much easier than with the current CSS (that requires at least to scan the whole variant css just to find which colors are in use). In addition, use something like that, could be transparent to someone creating a theme, because he can start from the expanded css (so plain css) and build on top of that.

But of course I posted because I'm not entirely convinced myself, and I'd like to hear opinions.

Quote from: wintstar – And it could the professionals developer create the Themes for money.
It's not that make money is a bad thing. :P
Bugs creator.
Features destroyer.
Template killer.

Re: SASS or LESS may be an option?

Reply #7

Like you said, you can always use CSS instead of SASS. Making sure you comment things comes in handy too. Define the variables early. We can even create a theme editor with it.


Re: SASS or LESS may be an option?

Reply #9

SASS/LESS is a tool to help CSS writers, foremost. It would certainly help those that do themes..not so sure about the average admin though. Unless you build an environment that already "works" and use SASS to alter key variables...or something to that nature, I am not that schooled in either SASS/LESS lol.

What i would recommend - if you are looking to make things easier - is to simplify the CSS as currently stands. Or add admin functions that alter key parts of the CSS file instead, sort of SASS for ElkArte. Since it has a great minifying function, it would make sense to have something like it.

Another way is to have the theme provide lots of options for users to tweak - again utilizing the combine/minimize function and caching it after each tweak. Not sure which is preferable lol, I've done some work in theme options so I tend to favor that since I have total freedom - but it does make it ahrder to be consistant across themes, backwards compatible that is. Not to mention its per-theme(although one could make the options be global/default too).

Mind you, its mostly SMF 2.0 things, but ElkArte shares alot of the theme features/code.


Re: SASS or LESS may be an option?

Reply #10

The Xydre theme stylesheets that I wrote a while back is written in SASS, though I never quite fully exploited it's variables to encompass Elkarte-specific stuff since very little from the default theme made it into the Xydre theme.

I think that using SASS in Elkarte is a fantastic idea. We could easily specify and change colour pallettes and go further with standardising stylings across the software.

Re: SASS or LESS may be an option?

Reply #11

Well im supporting both ideas, LESS and SASS, mainly because it lets you separate logics (if i can call it like that) and use variables. I dont see why it would discourage anyone as long as he/she searches google for a simple tutorial and documentation. And if ElkArte has already build in compiler that will look for changes in files and automatically compile our less/sass styles than i dont see a reason not to use it...If you think it will slow down big forums well maybe in production we could link to a precompiled CSS?

Also if we used less/sass i think we could simply read variables and allow users to edit them in admin panel. That way picking colors, changing font sizes and such would become piece of cake even for people that have no idea about css language...

Re: SASS or LESS may be an option?

Reply #12

Any hope of coming back to this? I don't see how SCSS is any harder than CSS. I'd create a "colors.scss" file that would allow admins to change their colors. Just define a bunch of variables in there and use those variables around the SCSS. Then, you can pretty much get rid of this idea of "variants" (I never liked it). You just give someone your "colors file" and they can use any SCSS compiler online if they don't have one locally. You can create a plugin to do this in PHP inside Elk with scssphp!

Most people, and what I'd consider best practice, is to define your colors separate of everything else. Using variables. Then you create a file that defines breakpoints. That defines the breakpoints for your grid. You define how wide those are in another file for those variables. You move page specific rules to their own files. Then... you compile them all together and create a single, massive CSS file. You distribute that unminified file alongside the SCSS dir. If people want to minify the CSS, they can do it on their own.

Develop an ecosystem for developers. Non-developer admins are just going to install plugins and grab someone's "colors" file and call it a day. Developers know and love SCSS.

Re: SASS or LESS may be an option?

Reply #13

I fully support this!

LiveGallery - Simple gallery addon for ElkArte

Re: SASS or LESS may be an option?

Reply #14

JFDI! :P
I think at that point (RC1) we can branch out 1.1 and let development run wild again, there is already quite a bit of stuff that can be done very quickly. O:-)

Quote from: Joshua Dickerson – You just give someone your "colors file" and they can use any SCSS compiler online if they don't have one locally. You can create a plugin to do this in PHP inside Elk with scssphp!
I would provide a way to compile it inside Elk, something like:
http://leafo.net/scssphp/
Bugs creator.
Features destroyer.
Template killer.