Ditching themes? (+ CSS preparsing)

Nao

  • Dadman with a boy
  • Posts: 16,079
Ditching themes? (+ CSS preparsing)
« on April 27th, 2011, 04:20 PM »Last edited on May 1st, 2011, 01:28 AM by Nao/Gilles
You know, I'm actually very tempted to ditch *themes* altogether...
I pretty much have the same view as Bloc on this matter. But I'm not the only one making decisions here, of course, and it's not a shared vision. I'm fine with it as long as I don't have to test my styling feature in other themes :niark:

At any rate, I would like to remove the "per theme" aspect of user settings, yes. Although I didn't know Bloc introduced special settings in his custom themes. Maybe this has a use in the end, then...?
Re: Ditching themes?
« Reply #1, on April 27th, 2011, 08:05 PM »
I have no idea. I'm really unsure what to do with theme settings. I'd tend to ditch everything and just assume that if someone uses a custom theme, they'll rarely change it, and so there's no reason to have different values for something. When it comes to board-specific themes, let's be realistic here: the news fader never shows up anywhere else than on the homepage anyway. So it's no big deal...

Then again, do we ditch the theme system at all?

I'd like to have opinions from everyone...
I don't really see a 'bad' point, in that it's really about turning themes into stylings. i.e. I could add the ability for stylings to specify new template files. Of course it makes for a strange mix of CSS, JS, XML and PHP in the same folder, but (1) there's nothing preventing the themer to put most of their non-CSS files into another folder as long as they're properly linked, (2) I think most themes don't have a lot of extra files anyway.

Snape

  • Posts: 14
Re: Ditching themes?
« Reply #2, on April 27th, 2011, 08:46 PM »
Personally, I moved away from themes on my board more because of differences between 2.0 revisions than mods.  Most themes seem to be dependent on the RC code and the theme authors tend to not revisit them between versions, waiting for "2.0 to go final".  Bloc's themes have been the notable exceptions, but even so, the only theme-related gripes I experience these days are from users on mobile devices.

It would be nice to see a more modular approach, specifically consistency with board features tied to permissions.  For example, I modified the templates to only render the who's online option if the user has the permission 'who_view'. 

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Ditching themes?
« Reply #3, on April 30th, 2011, 11:38 AM »
Split topic into its own... Calling for advice.

Joker™

  • Posts: 6
Re: Ditching themes?
« Reply #4, on April 30th, 2011, 12:26 PM »
First of all hello to everyone,

Nao as we can see in SMF itself most themes are curve based with some variation in images, so why not create a default theme using as less images as possible and then creating a section in admin panel where the admin can make the color variations by just putting color hex codes.

So it will provide a nice platform to admins to play with there themes and modify there forum looks as they want in very easy manner.

Just a suggestion :).

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Ditching themes?
« Reply #5, on April 30th, 2011, 12:51 PM »
Well right now it's very easy to change using an add-type styling. Hello.

Joker™

  • Posts: 6
Re: Ditching themes?
« Reply #6, on April 30th, 2011, 05:03 PM »
Quote from Nao/Gilles on April 30th, 2011, 12:51 PM
Well right now it's very easy to change using an add-type styling.
Yup seen it on some sites also. My main point was that even if a mod has made changes in the template then also the admin will be having a very flexible option of changing his forum colors.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Ditching themes?
« Reply #7, on April 30th, 2011, 05:03 PM »
Yeah, I'll agree with that, it's very, very easy to make colour variations - even I can manage it without too much hassle, which says something.

Though we're planning on making it so that editing a theme affects mods less and vice versa.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Ditching themes?
« Reply #8, on April 30th, 2011, 05:18 PM »
I'm not much of a fan of noob-friendly CSS editing, personally. Tempted to get rid of that editor in the admin area. As for allowing people to set default colors for a styling, hmm... I guess it's doable, but only through using CSS variables. It can be done, but really, I imagine it would complicate things for Wedge at compilation time. Maybe by allowing to override only the actual CSS variables in the code...

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Ditching themes?
« Reply #9, on April 30th, 2011, 05:22 PM »
The problem with making noob-friendly editing tools is that invariably it hampers those already familiar/the pro folks. I don't use the theme editing tools in SMF because they're the very worst kind: no good for noobs because they're too complex, and no good for competent folks because it's too basic.

I would actually rip it out because it doesn't add anything. One fact I would note: the only reason that there's a tool generating theme modules for 1.1.x that are colour variations is because a certain someone originally wrote one for their hosting platform, and no-one's done it for 2.0 to make the main block image because people will rather use Photoshop etc. to do it... no-one makes tools for that particular job because it's not in anyone's interest to do so.

Joker™

  • Posts: 6
Re: Ditching themes?
« Reply #10, on April 30th, 2011, 05:26 PM »
Quote from Arantor on April 30th, 2011, 05:03 PM
Though we're planning on making it so that editing a theme affects mods less and vice versa.
How much hard you try but there will be a point where mods will affect theme and some hard situations might arise.
Quote from Nao/Gilles on April 30th, 2011, 05:18 PM
I'm not much of a fan of noob-friendly CSS editing, personally. Tempted to get rid of that editor in the admin area. As for allowing people to set default colors for a styling, hmm... I guess it's doable, but only through using CSS variables. It can be done, but really, I imagine it would complicate things for Wedge at compilation time. Maybe by allowing to override only the actual CSS variables in the code...
I myself has never used the editor in admin area(talking about the one in SMF), it makes things to look much more complicated to me.
You can create a script which can refresh the css cache if the user has made changes in css through admin panel.


One more suggestion if you people think of going with the above suggestion that do create backup css files so that even if one wants to have the old styling back he can simply get it back from backup css file.


Edit - Just saw Arantor's reply
Arantor why don't you make a css code highlighter in admin panel itself so that it will be much easier to read the css code.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Ditching themes?
« Reply #11, on April 30th, 2011, 05:28 PM »
Quote
You can create a script which can refresh the css cache if the user has made changes in css through admin panel.
It's a LOT more complex than that. There are no normal CSS files in Wedge, they are all Sass type files now, so you'd have to edit them, recache them then re-serve them.

Joker™

  • Posts: 6
Re: Ditching themes?
« Reply #12, on April 30th, 2011, 05:30 PM »
Quote from Arantor on April 30th, 2011, 05:28 PM
It's a LOT more complex than that. There are no normal CSS files in Wedge, they are all Sass type files now, so you'd have to edit them, recache them then re-serve them.
Oh not much familiar with the wedge code. Even have to search about sass file types also :P.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Ditching themes?
« Reply #13, on April 30th, 2011, 05:33 PM »
Heh, well suffice to say that it takes some of the elegance of Python source and applies that to CSS, such that things are much more visually distinct and approachable at a glance than CSS normally is.

But of course since none of the browsers support it, it has to be processed first.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Ditching themes?
« Reply #14, on April 30th, 2011, 06:43 PM »
Hmm yeah I could still see myself doing something like this...

- Retrieve all variables from the wecss files,
- Retrieve a $modSettings['css_vars'] variable that contains potential replacements for them,
- Do the replacement before passing the css vars.

And in the admin area -- retrieve variables from the wecss files, list them ("$main_font", etc.), and offer to overwrite them. If one of them is detected to be a color variable ("rgba(0,0,0, .5)", etc.), we could also offer a color wheel to pick a new one.

@Joker> Actually it's only Sass-style by inspiration. I read about Sass in .net Magazine last January, loved how their idea was going further than my original plans for a css preparser, which encouraged me to do a PHP version of it. In the end it hasn't got half of the Sass features, and it's certainly not as elegant, but it's much, much faster, and at least you don't have to remember 50 different functions eheh. Plus, my implementation has some cool extra features that no other css preparsers have. (Notably the 'final' keyword which is important for object oriented programming. You'll see when I publish the feature list.)

Here's a sample from my index.css code:

Code: [Select]
section.block extends .wrc
overflow: hidden
header extends .wehead
font-weight: 700
padding: 3px 12px
border-radius: 8px 8px 0 0
margin: -0.9em -1.2em 1em
footer extends .wefoot
padding: 3px 12px
border-radius: 0 0 8px 8px
margin: .5em -1.2em -0.9em
dl.settings
margin, padding: 0

Fun, eh? :)