Originally Posted by
mechaflash
Originally Posted by
Ruud
Is there a guideline to what html elements, classnames to use and id conventions to follow? Without that, the proposed structure would probably have unpredictable results. There would be now way of surely targeting specific elements using CSS.
If you think about it, the people doing the styling will give class names/IDs to all of the elements anyways. More than likely, we're going to be finding maybe the first few stylesheets actually being "Unique" and the rest are spinoffs of these, recycling the given classes/IDs assigned to the elements. So I don't see much of an issue with this. Plus, those that know how to style modules, know how to assign class names to elements in the modules... I would hope :?
I think you are missing the point here. But also misunderstand how styling works. It is the developer who writes the default HTML template and thereby determines what classnames are in the HTML. A user has limited options when using standard templates and almost complete freedom when changing each template themselves. But neither is the case if your idea is to work. (The user should not have to use options because that is in many cases too complicated for the targeted user)
Example:
We have DEV S (standard) who made a module that outputs:
Code:
<div class="content-el">
<h2>Some header</h2>
Some content</p>
</div>
DEV N (non standard) who made the same module that outputs:
Code:
<div class="contentElement">
<h2>A header</h2>
<p class="contents">Text here</p>
</div>
They both generated perfectly fine code. Lets call DEV S' code the agreed standard. If the CSS guru's start making templates they do not know or have ever met either DEV. In order to be able to offer a theme that right from the bat will style a module correctly both the module and the theme will have to follow the same rules and naming schemes.
GURU S creates the following theme:
Code:
.content-el h2 {
color: red;
font-size: 16px;
margin-bottom: 4px;
}
GURU N creates a theme:
Code:
.block .contents h3 {
color: green;
text-decoration: underline;
}
Now you can see that DEV S + GURU S is the only combination that makes sense. Neither of the other two result in styled elements.
So I'd say a convention that defines which html elements must be used in specific places is needed. And a naming scheme for classes and ids. Default Contao templates seem to follow a scheme, though it is not enforced. So there is a lot of work to do to get the idea up and running....
Bookmarks