Core vs. content links styling

Please post the URLs to pages, where you've made a CMSimple template available for download

Moderator: mikey

Tata
Posts: 2880
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Core vs. content links styling

Post by Tata » Fri Nov 16, 2018 7:52 am

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?
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

frase
Posts: 2343
Joined: Thu Apr 21, 2016 6:32 am
Location: Saxony
Contact:

Re: Core vs. content links styling

Post by frase » Fri Nov 16, 2018 8:08 am

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:

lck
Posts: 1380
Joined: Wed Mar 23, 2011 11:43 am
Contact:

Re: Core vs. content links styling

Post by lck » Fri Nov 16, 2018 10:38 am

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;
}
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“   👉 Ludwig's XH-Templates for MultiPage & OnePage

frase
Posts: 2343
Joined: Thu Apr 21, 2016 6:32 am
Location: Saxony
Contact:

Re: Core vs. content links styling

Post by frase » Fri Nov 16, 2018 11:40 am

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.

Tata
Posts: 2880
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Core vs. content links styling

Post by Tata » Fri Nov 16, 2018 11:58 am

Thanks to all. I will review all my templates, as I use often the global styling and almost never prefixed classes.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

frase
Posts: 2343
Joined: Thu Apr 21, 2016 6:32 am
Location: Saxony
Contact:

Re: Core vs. content links styling

Post by frase » Fri Nov 16, 2018 12:07 pm

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.

cmb
Posts: 12940
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Core vs. content links styling

Post by cmb » 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. :)
Christoph M. Becker –Plugins for CMSimple_XH

frase
Posts: 2343
Joined: Thu Apr 21, 2016 6:32 am
Location: Saxony
Contact:

Re: Core vs. content links styling

Post by frase » Fri Nov 16, 2018 1:00 pm

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.

cmb
Posts: 12940
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Core vs. content links styling

Post by cmb » Fri Nov 16, 2018 1:11 pm

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.
Christoph M. Becker –Plugins for CMSimple_XH

Tata
Posts: 2880
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Core vs. content links styling

Post by Tata » Fri Nov 16, 2018 2:30 pm

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.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Post Reply