Sweaver having a css styler is a very powerfull thing that allows us web designers to edit almost any template.

However some themes have a lot of divs and containers, and selecting the right css selector could be a bit tricky especially for a end user that doesn't know css concepts at all.

If the theme creator/editor can limit somehow the ids and classes of the elements that can be selected/styled It would be more easy to just to point and click and change the styles visually.

I have been thinking in how can acheive this myself, what could be the most friendly theme to use, or how can I make a starter theme myself using very few divs and very simple structure, but the .info fyle system is already being use for the theme style, so maybe my idea makes sense.

Comments

pitxels’s picture

Issue summary: View changes

typo

Anonymous’s picture

Hi pitxels,

I had the same problem as yours a couple of months ago and the solution I put in Sweaver was to be able to define selectors inj the .info file. This system is described in the API file :

2. Selectors

You can also define selectors per theme in the info file, eg:

sweaver[selectors][body] = Body
sweaver[selectors][h1] = Heading 1
...

The order is how you define it in the info file.
In the backend you can select if these selectors
are to be used instead of those in the database.

Those selectors will be exclusive. Which means that the
user will only be able to select and modify those defined selectors

To define inclusive selectors (which will be added to others 
created in the regestry) you need to add options to your selectors

sweaver[selectors][h4][name] = h4
sweaver[selectors][h4][description] = Heading 4
sweaver[selectors][h4][selector_highlight] = TRUE
sweaver[selectors][h4][weight] = 20
sweaver[selectors][h4][type] = add

 - The name must contain only lowercase letters, numbers, underscores or hyphens
 and must be unique.
 - The selector description is the text shown to the Sweaver front end user
 - The selector_highlight property define weither or not the selector should be
 highlighted by default
 - The weight is a very important element as it define the priority of this
 selector on others. A value between 20 and 50 is advisable for major selectors
 and a value between 70 and 100 for minors ones.
 - The type is either set as add for inclusive or replace for excluse selector

Note: if you add new theme extensions but they don't show up,
then you need to clear the theme registry.

I use this on all my themes and it is very powerful. Selectors well defined with this solution can help quite a lot users. The general idea that you have to understand for this to work is that you have to define selectors that will ehelp the selection to be done properly. For example you could define "#header" or "#main-menu" so that the modification of the main-amin will not affect any other part of the website.

Does that answer your issue ?

pitxels’s picture

oh that's great :) thanks for your prompt support

Anonymous’s picture

Status: Active » Fixed

Closing

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

typo