contao / official-demo

Contao Official Demo
17 stars 14 forks source link

Static Layout of #wrapper for Contao Demo is not working (4.8.7 API version 2) #96

Closed lolohz closed 4 years ago

lolohz commented 4 years ago

Hello This issue is described in https://github.com/contao/contao/issues/1314 and https://github.com/contao/contao/pull/1585

It seems that Contao Official Demo needs an update, but I don't know if it must wait for a future development of a new grid/flex solution of Contao, and then this issue could be a request.

I'll very pleasant to contribute if it is possible and if someone tell me how to do it. I'm a computer engineer.

Best regards.

sascha-mueller commented 4 years ago

I dout think it is a bug in the official demo. contao itself adds stylessheets after inline-styles, so CSS file overwrites CSS rules with equal specifity.

If I haven't missed anything, contao does not use a fe_page template. In this case the core templates are used.

In short test seems to offer a simple solution: Open the SCSS file (contaodemo/theme/scss/layout/_layout.scss) and change id="wrapper" to [id="wrapper"]

The statement [id="wrapper"] is weighted like a CSS class. The specificity of [id="wrapper"] is higher than that of a CSS class, so id="wrapper" should have the higher value.

I think the option "Static Layout" is deprecated and should be removed as well as the editor.

lolohz commented 4 years ago

Hello Sascha Thanks for your quick answer and the work around, but I didn't found id="wrapper" in contaodemo/theme/scss/layout/_layout.scss My file contains: / Layout parts /

wrapper {

background-color: $wrapperBgColor;

}

By the way, I would like to say you I'm somewhat disoriented: The layout of html elements is established by css files, the item composition/tree of html items themselves, their style attributes and the javascript that change those attributes. Currently Contao have two "actors" providing those resources, the internal Framework and the user Themes, combined in the final output. Now that the css online editor has been deprecated, the Theme manager only allow the user change some attributes. Is Contao responsible of managing the front-end layout?. If, so, if the option to change the size of an item of the layout is disposed then it is given that responsibility to the user css/js/html, and then only advanced users will be able to do it, such Theme vendors, and not the general people with low knowledge about css. What sense is having a Layout editor that doesn't allow change the sizes easily to adapt to our needs?

I think this scene is because we have no clear what properties of an style should be edited using Contao back-end and what others should be edited by the user through css files. Let me compare to buildings to be clearer. We have architectural styles defined by the disposition of the elements, the construction materials, and their decorations. The disposition is defined in the Themes and they use Layouts and Modules for that disposition and currently we should are able to make some changes in the disposition of the main elements using Contao back-end, if it is working. In my previous issue Leo said that there is a bug in Demo package, but now I'm not sure. Anyway the behavior of Contao is clear for me. I think it is possible people find Layout hard to use or not useful and they are using bought or free themes without changing attributes such as "Overall width".

Thanks for all and best regards.