-
-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Queryads single DIV and responsive CSS (fixed) #1952
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion in #1461 is to use unique classes not IDs. But anyway, I don't have the time to look into this more. |
I used classes for most elements. I just used IDs on specific and unique elements, that appear only once on each page and already had IDs configured. CSS IDs can be used on unique elements, but if you prefer I can replace them with new classes. |
Can someone please list off the pros cons of IDs vs unique classes? I'm not a (natural) web developer so I'll need something to inform a decision, cheers! |
On the visual side, there isn't much difference. CSS will be applied (to classes or IDs) by the browser. Usually I don't recommend the indiscriminate use of IDs in CSS. Generally speaking (in CSS, javascript, jQuery, etc.):
Example: IDs have greater specificity. This means they should only be used to style specific and unique items. It is not a good practice to create IDs just to apply to styles, except in cases where the element is really specific / unique (I think that's our case here). On the other hand, when IDs already exist, there are no restrictions on applying CSS to them. NOTE: I don't want to create problems. If you prefer I can replace the IDs with new classes. https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors/Type_Class_and_ID_Selectors |
Thanks for your explanation. This is an edge-case: there are only 2 elements - having a unique class or unique IDs seems like a tie here. I'm fine with the way it is now. |
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/pi-hole-ftl-v5-12-web-v5-9-and-core-v5-7-released/51795/1 |
By submitting this pull request, I confirm the following:
git rebase
)git commit --signoff
)What does this PR aim to accomplish?:
This PR fixes #1461 (and related comment in #1284)
How does this PR accomplish the above?:
This PR removes the double DIV solution introduced in #1284 and #1264 and replaces it with a different approach.
A single div + responsive CSS targeting the div and its inner elements.
What documentation changes (if any) are needed to support this PR?:
none