Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Add external stylesheets position to tl_layout #6937

Closed

Conversation

ausi
Copy link
Member

@ausi ausi commented May 2, 2014

This could be very useful, e.g. if you load a large external stylesheet and want to overwrite small parts of it with the internal stylesheet editor.

@leofeyer
Copy link
Member

leofeyer commented Sep 5, 2014

Wouldn't it make sense to always load the external style sheets before the internal ones? The current hierarchy seems wrong to me:

  • System style sheets
  • Module style sheets
  • Dynamic style sheets
  • Internal style sheets
  • External style sheets

IMHO, the last two should be permanently switched.

@ausi
Copy link
Member Author

ausi commented Sep 5, 2014

I think both orders make sense, depends on the use case. The best solution would be to sort external and internal stylesheets combined.

@leofeyer
Copy link
Member

leofeyer commented Sep 5, 2014

I can think of two use cases:

a) Only external style sheets
b) External and internal style sheets

In case a), you can sort the style sheets already -> everything is fine.

In case b), you are most likely using a theme, which stores CSS files in the files directory. To adjust the theme, you want to use the internal editor, however, the internal style sheets are add after the default theme files instead of before.

Can you think of any other use case?

@ausi
Copy link
Member Author

ausi commented Sep 6, 2014

It could also be that the theme uses internal stylesheets and you want to customize that theme with an external stylesheet.

@leofeyer
Copy link
Member

leofeyer commented Sep 6, 2014

Yeah, but that's an edge case IMHO. Normally people are using the internal editor to customize themes, because it is easier to use for end clients.

I'm only trying to keep the number of form fields as small as it can be. There are already a lot of fields in tl_layout, therefore I would prefer not to add another one.

@Aybee
Copy link
Contributor

Aybee commented Sep 6, 2014

Yeah, but that's an edge case IMHO. Normally people are using the internal editor to customize themes, because it is easier to use for end clients.

To me the other way round it's an edge case.

I think in an enterprise CMS end clients are mostly developers and developers mostly work with CSS files in /files/css/. In my case sometimes there are situations where some Contao internal CSS files exists which I don't like to touch and want to overwrite with my CSS (themes, Contao framework CSS). Mostly I have no internal files.

Also imagine the situation your customer asks you to modify/corrrect his stylesheet, which I have very often. Then it's easy for me to add my custom external file to adjust his CSS.

I prefere that externals overwrite internals.

@ausi
Copy link
Member Author

ausi commented Sep 6, 2014

What about handling external and internal style sheets the same way, both in tl_style_sheet? So, for an external style sheet you would create a new record in tl_style_sheet, choose the type external and select the CSS file. This way you would be able to sort them in any order.

@Aybee
Copy link
Contributor

Aybee commented Sep 6, 2014

@ausi
nice, this is the theme+ way 👍

@leofeyer
Copy link
Member

leofeyer commented Sep 7, 2014

We have already tried to implement it this way and for some reason (which I don't remember) we have decided against it.

@leofeyer
Copy link
Member

leofeyer commented Sep 8, 2014

I have made a few adjustments to @ausi's initial PR and merged it in 8a57310. Mainly wording changes such as using "loading order" instead of "external position".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants