Loading...

Top
PFQ Banner

This is PokéFarm Q, a free online Pokémon collectables game.

Already a user? New to PFQ?

Guide to CSS: Beginner to Expert

Forum Index > PokéFarm > Guides >

Pages: 123··· 7891011··· 282930

Aemilia's AvatarAemilia
Aemilia's Avatar
Exact pixel lengths are not recommended because it won't always be mobile friendly. But yes, you can use measurements so long as it remains mobile friendly
Buying: BSDs 20 ZC Prisms 70 ZC
Icons/Template by Aemilia

by Kaede

Understood. I will just go back and forth betweem pixel and percentage until I find the correct percentage number. I'll get cracking and will return if I need more help. Thank you so much for your time and knowledge!
On The Next Stream...

Time & Place: ? on Twitch (Live Countdown) Game(s): [On a semi-hiatus.] My channel link is in my profile under (+18) Mature Code. Thank you for the support!
Credits in Profile

Wishlist

Niet [Adam]'s AvatarNiet [Adam]
Niet [Adam]'s Avatar
I've seen some pretty ugly hacks for "hide this if the number is zero", including such things as font-size: [math]NUMBER / NUMBER[/math]em; (which "works" by abusing the fact that dividing by zero with the [math] code returns zero, and anything else returns one - but it doesn't "work" if the browser enforces a minimum font size for accessibility reasons!) Here's a much cleaner way: .hide-when-zero(@number) when (@number = 0) { display: none; } .fire-fang { .hide-when-zero([inventory=Fire Fang]); } // repeat for other items This makes use of LESS Mixin Guards, and allows much more control. You could even do stuff with ranges of numbers, let's say you want to hide when zero, fade out things you have less than 5 of, and bold things you have at least 20 of. Easy! .number-formatting(@number) when (@number = 0) { display: none; } .number-formatting(@number) when (5 > @number) { // note you must use 5 > @number instead of @number < 5 // because the < is converted to &lt; and breaks LESS opacity: 0.5; } .number-formatting(@number) when (@number >= 20) { font-weight: bold; } .fire-fang { .number-formatting([inventory=Fire Fang]); } // repeat for other items Example (not actual inventory numbers, just testing!)
×1
×7
×23
Clip from Pokémon anime, re-lined by me
-- OMNOMNOM!
Featured story: Injustice Feedback welcome!
That is super helpful, thank you so much!
Aemilia's AvatarAemilia
Aemilia's Avatar
Gonna ask here as well as in the discord chat. Do you guys think adding a section on a section about LESS and some functions for LESS is something you guys would like to see? Feel free to just upvote if you would like to see it or post if there's specific things you know of/might think would be possible with LESS (I know not everyone is familiar with it, so even if you aren't, I am willing to do the research if necessary for anything I don't know already).
What is LESS? It sounds interesting. What would we be able to do with it?
Mirzam's AvatarMirzam
Mirzam's Avatar
LESS is a language extension for CSS that lets you use features that make CSS easier to write, and then you compile it down to CSS to actually use it on a site. On PFQ, Niet has set it up so our templates and skins can use LESS. The most commonly used features I've seen here are nesting and variables, but there is more. (I love nesting so much I'll probably never write vanilla CSS again if I can lol) https://lesscss.org/ Note on variables: all the skin colors set in the non-CSS part of the editor have variables that you can access in post templates. There's a list of them on the BBCode page on the wiki. You can do some neat stuff with that but make sure to test it on a variety of skins - I try with the default skin, a light skin, a dark skin, and a specialized test skin with clashing colors so I can tell exactly which colors end up where.
That is great, thank you so much! I will look into this later. I'd love a guide for LESS!
Aemilia's AvatarAemilia
Aemilia's Avatar

QUOTE originally posted by Aemilia

Gonna ask here as well as in the discord chat. Do you guys think adding a section on a section about LESS and some functions for LESS is something you guys would like to see? Feel free to just upvote if you would like to see it or post if there's specific things you know of/might think would be possible with LESS (I know not everyone is familiar with it, so even if you aren't, I am willing to do the research if necessary for anything I don't know already).
Alternatively, I could do a different guide devoted to LESS specifically, if you guys would prefer that, lmk by upvoting this post instead XD
veliona's Avatarveliona
veliona's Avatar
for a template to be considered legible do pokemon panels have to be styled as well?
Übercharm

Übercharm

Account Upgrade

(: 0)

An overpowered charm that, when activated, massively increases your chances of hatching Melanistic Pokémon for 28 days.

Sells for 2,000

Lv. 100 — Locked
Aspear BerryAspear Berry
Aspear Berry (SOUR)
Cheri BerryCheri Berry
Cheri Berry (SPICY)
Chesto BerryChesto Berry
Chesto Berry (DRY)
Pecha BerryPecha Berry
Pecha Berry (SWEET)
Rawst BerryRawst Berry
Rawst Berry (BITTER)
Likes:
Dry food
SteelPsychic
Happiness 27%
Rash nature
avatar

Pages: 123··· 7891011··· 282930

Cannot post: Please log in to post

© PokéFarm 2009-2024 (Full details)Contact | Rules | Privacy | Reviews 4.6★Get shortlink for this page