Page 1 of 2

Core vs. content links styling

Posted: Fri Nov 16, 2018 7:52 am
by Tata
I made a links style in the stylesheet

Code: Select all

.content a{
	color: orange; text-decoration: none;
}
.content a:hover{
	color: red;
}
Now I see the same styling used on editor tabs (Meta, Page etc.). The only way to keep these tab-links not formated was adding

Code: Select all

.content a span{
	color: #000;
}
to the stylesheet.
Is there another way to keep these styling independent from the stylesheet?

Re: Core vs. content links styling

Posted: Fri Nov 16, 2018 8:08 am
by frase
Tata wrote:
Fri Nov 16, 2018 7:52 am
Is there another way to keep these styling independent from the stylesheet?
http://fhs.bplaced.net/xhStyleGuide/?Gr ... hcontainer
:lol:

Re: Core vs. content links styling

Posted: Fri Nov 16, 2018 10:38 am
by lck
Tata wrote:
Fri Nov 16, 2018 7:52 am
Is there another way to keep these styling independent from the stylesheet?
Yes, by using a prefix for your template styles. Example for .content: .tpl_content or .tpl-content or .tata-content ...

BTW: These global styles can and will also cause problems, be it in the backend or with plugins, etc.

Code: Select all

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}
If so, it would be better to apply them only to the content area or just to certain areas, for example:

Code: Select all

.tpl_content * {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

Re: Core vs. content links styling

Posted: Fri Nov 16, 2018 11:40 am
by frase
lck wrote:
Fri Nov 16, 2018 10:38 am
Yes, by using a prefix for your template styles.
Das Thema ist ein "heißes Eisen".
Wie stylest du zum Beispiel die Trefferliste nach einer Suchanfrage?
Keine Schanze Chance.

Re: Core vs. content links styling

Posted: Fri Nov 16, 2018 11:58 am
by Tata
Thanks to all. I will review all my templates, as I use often the global styling and almost never prefixed classes.

Re: Core vs. content links styling

Posted: Fri Nov 16, 2018 12:07 pm
by frase
Der Nachteil ist, dass Benutzer deiner Templates dann jedesmal, wenn sie zum Beispiel eine Liste setzen wollen, nicht nur einfach im Editor auf das Listensymbol klicken können - sondern zusätzlich noch die spezielle Klasse wählen müssen.
Ich mache das in meinen Templates auch so. Aber immer wieder gibt es trotzdem Konflikte. Dein Beispiel mit den Links <a> zeigt das gut. Wenn du da ein Präfix einführst, muss der Benutzer dann jeden Link nochmals mit einer Klasse versehen.
Inauspicious.

Re: Core vs. content links styling

Posted: Fri Nov 16, 2018 12:45 pm
by cmb
frase wrote:
Fri Nov 16, 2018 11:40 am
Wie stylest du zum Beispiel die Trefferliste nach einer Suchanfrage?
Keine Schanze Chance.

Code: Select all

.xh_search_results {}
.xh_search_results li {}
Wer den Effekt sehen möchte, muss halt die unglaublich umfangreichen Änderungen im Code selbst durchführen. :)

Re: Core vs. content links styling

Posted: Fri Nov 16, 2018 1:00 pm
by frase
cmb wrote:
Fri Nov 16, 2018 12:45 pm
frase wrote:
Fri Nov 16, 2018 11:40 am
Wie stylest du zum Beispiel die Trefferliste nach einer Suchanfrage?
Keine Schanze Chance.

Code: Select all

.xh_search_results {}
.xh_search_results li {}
Wer den Effekt sehen möchte, muss halt die unglaublich umfangreichen Änderungen im Code selbst durchführen. :)
Leider war das nur ein Beispiel. Da gibt es noch viele andere.

Re: Core vs. content links styling

Posted: Fri Nov 16, 2018 1:11 pm
by cmb
frase wrote:
Fri Nov 16, 2018 1:00 pm
Leider war das nur ein Beispiel. Da gibt es noch viele andere.
Ja, weiß ich doch. Daher ja auch die Überlegungen bzgl. Style-Guide und Admin-Template.

Re: Core vs. content links styling

Posted: Fri Nov 16, 2018 2:30 pm
by Tata
Würde nicht genügen im core stylesheet algemein "!important" und Prefix "core_" nutzen? Das selbe dann auch in plugins. Dann wäre es wohl einfacher die Templates zu stylen.