Help Me Senpai

0written posts
Deletedearned bits
offlinecurrently
Deleted
Deleted Avatar

Okay, so im creating new templates for my pokemon site, and one thing ive always wanted to delve into but was unsure about, --is app templates that change accent colors depending on group. I have a small understanding on how it works, i.e
[div][attr="class","groupname"]
and the remaining code responds off of that, but I need to know more about the inner workings of it. Mostly the css part of the newclass.

Would it just be easier to put pastebin's up for every group with just different colors? Any tips regarding this subject would help alot.

last edit on Sept 3, 2018 0:46:59 GMT by Deleted
frog on the floor
aliasfreiheit, microwaved burrito
pronounsany
1,504written posts
pharaoh leapearned bits
offlinecurrently
pharaoh leap
Administrator
pharaoh leap Avatar
i've been having some pretty dark thoughts.
What you can do with CSS is definite a class – and then redefine that class when it appears within another class. How this is usually done in apps is that you specify the name will show up as yellow normally, but when that name is inside the class GROUPNAME, it'll show up as red, instead. This “overwrite” only works on the attributes you specify in the “overwrite”, so doing something like:

.class { height:20px;width:20px;background-color:red; }
.GROUPNAME .class { background-color:blue; }


will only change the background color, while leaving the other attributes as they're specified in the default .class styling.

That's the jist of it, anyway! Basically, by surrounding the whole app template in a GROUPNAME class, you can call on any class in the template and have it change depending on the name of that outside div. You could technically also surround each individual div you want to change with the GROUPNAME class'd div to get the same effect, but that's super tedious for both the coder and the app writer, so just... don't... do that.

Depending on the number of member groups you have on site, it may be easier to just set up pastebins with the GROUPNAME class already written in, but if you have, like, four or more member groups, it's probably easier just to direct people to where to change it, since it's really only finding and changing one word to one different word. You can make it easy to spot by having the very first line of code in the app be the div you change the name of, and only that div. Just remember that the name is going to be case-sensitive, so make sure people to know to change it to the proper casing.

Hopefully this answers your questions? ;u;
0written posts
Deletedearned bits
offlinecurrently
Deleted
Deleted Avatar

sits back and contemplates life

so that's it? Just adding that extra tag. Why did I make this out to be harder than it needed to be lol... Do you think it would be better to put the css in my stylesheet like you did on TBE?


frog on the floor
aliasfreiheit, microwaved burrito
pronounsany
1,504written posts
pharaoh leapearned bits
offlinecurrently
pharaoh leap
Administrator
pharaoh leap Avatar
i've been having some pretty dark thoughts.
That's entirely up to you! There are some pros and cons.

I mostly put the CSS directly into the skin because it made styling it a lot easier with the visual editor (since I write up HTML in its entirety first, and then write up CSS afterward), but more importantly, it cuts down on a LOT of space in the code that people need to copy, paste, and edit. My thought process was that, the less bulky code there was in the template, the less likely less code literate members would get lost trying to find where they needed to edit things.

On the flip side, I've been told by people with slower Internet that CSS loading from the skin is slower than CSS loading from the template. This isn't really a problem if it's just the app in its app thread, but it can bog down loading times if you're looking at, like, the recent posts page and there are ten separate apps there.

I'd say code clarity takes priority over loading time in this case, mostly because it's not an issue on the page where it most counts (the app thread itself). For stuff like a member directory with individual members posts, though, it's better to put the CSS directly into the template, otherwise you'll end up leaving your slower-Internet-having members to DIE.
last edit on Sept 3, 2018 2:12:31 GMT by pharaoh leap
0written posts
Deletedearned bits
offlinecurrently
Deleted
Deleted Avatar

mmm that makes sense. I've never put my newclass directly into the style sheet before, is there something specific I need to do beforehand? I am probably overthinking that as well but do i have to put a specific .tag before anything and everything relative to the app then? And thank you for the help


frog on the floor
aliasfreiheit, microwaved burrito
pronounsany
1,504written posts
pharaoh leapearned bits
offlinecurrently
pharaoh leap
Administrator
pharaoh leap Avatar
i've been having some pretty dark thoughts.
Nope~! The only difference is that, instead of writing it like
[attr="class","... you write it like normal CSS. But you probably had that figured out yourself. ;o

It's no trouble at all, though~! <3 Lemme know if there was anything yet that you had questions about!
3,084written posts
Kitten4uearned bits
offlinecurrently
Kitten4u
Part of the Furniture
Kitten4u Avatar
[nospaces]

[attr="class","infoBG"]
[attr="class","infoBG2"]
[attr="class","infoBack"]
[attr="class","infoTitle"][attr="class","fa fa-star-o"] threadarchived
[attr="class","infoDiv"]

[attr="class","infoBody"]

To keep the forum clean and so people know that all threads in certain areas are current and that the OP is likely to still have interest, we archive threads that haven't gotten posts for 2 weeks. This thread is being archived for that reason. If you would like this thread reopened, contact a staff member.