Host
Host
KPCKevin Powell - Community
Created by Host on 5/22/2024 in #front-end
Intrinsic style, or least specificity
This might be a silly question, but I want to create a custom component from scratch (an input element for forms that uses Javascript), and I'm wondering how to give it some initial dimensions (and other styles) in a way that can be easily overridden. There doesn't seem to be a way to apply styles with a minimum specificity, kind of like user agent styles, or is there? For example, the textarea in my browser (Safari) has a size of 155px by 26px which seems to be its intrinsic size (https://developer.mozilla.org/en-US/docs/Glossary/Intrinsic_Size) as there isn't even a UA style setting that size that I can see in the web inspector. I would like to be able to set such an intrinsic size (and other styles) on an element so that it doesn't have either a size of zero (or just too tiny) or fills the whole screen/container -- like the textarea. And without the user/me later having to know/overpower some arbitrary specificity, a sort of !unimportant if you will. Am I making much sense here?
6 replies
KPCKevin Powell - Community
Created by Host on 4/26/2024 in #front-end
Vertical alignment without wrapper?
Problem: https://codepen.io/peendoc/pen/YzMgrwN I want the links to be clickable along the entire height of the ul but also the text to be vertically centered. Do I need a wrapper inside the a tags to accomplish this? I know there are different techniques but the ones I've seen need a wrapper that is bigger than the text being wrapped, and I'm just wondering if there is any modern CSS way to do it that doesn't need an extra wrapper in this specific example.
3 replies