Select Page

Category: Link

The dialog element

Chris Manning digs into : A dialog element provides: An element that is easy to show and hide, including an open boolean attribute on the element itself. Two versions: a standard popover or modal version. A ::backdrop pseudo-element for modal types. Built-in focus: see dialog focusing steps. ARIA role support (dialog is the implied default). Also accepts the alertdialog role. A pending stack for multiple dialogs. A DOM interface with the open boolean and methods show, showModal, and close. And those are just some highlights! Showing content on top of other content has never been easier. This is the evolution of the web at it’s best. Identifying a major developer struggle and helping solve it. Direct Link to Article — Permalink The post The dialog element appeared first on CSS-Tricks....

Read More

Unbuttoning Buttons

We dug into overriding default buttons styles not long ago here on CSS-Tricks. With garden-variety fully cross-browser-supported styles, you’re looking at 6-10 CSS rules to tear down anything you need to off a button and then put in place your own styles. Hardly a big deal if you ask me, especially since it’s extremely likely you’ll be styling buttons anyway. Scott O’Hara has taken a look as well. I think the solution offered to use a is a little bizarre since you need bring your own keyboard handling with is non-trivial and requires JavaScript. But there are a couple of interesting other CSS explorations, neither of which stacked up for different reasons: display: contents; – some semantics-based accessibility problems. all: unset; – doesn’t reset display value, not good enough browser support. Direct Link to Article — Permalink The post Unbuttoning Buttons appeared first on CSS-Tricks....

Read More

CSS Only Floated Labels with :placeholder-shown pseudo class

The floated label technique has been around for a good long while and the general idea is this: we have an text input with the placeholder attribute acting as a label. When a user types into that input, the label moves from inside the input to outside of it. Like so: Although I don’t see this pattern used on the web all that much, I do think it’s an interesting one! There are different approaches to it, but Nick Salloum describes a new one using a combination of :not and :placeholder-shown: This UI technique does indeed slightly bend the...

Read More

The Codification of Design

Jonathan Snook on managing the complexity between what designers make and what developers end up building: Everything that a designer draws in a Sketch or Photoshop file needs to be turned into code. Code needs to be developed, delivered to the user, and maintained by the team. That means that complexity in design can lead to complexity in code. That’s not to say that complexity isn’t allowed. However, it is important to consider what the impact of that complexity is—especially as it relates to your codebase. Jonathan continues in that post to argue that designers and developers need to be in a constant feedback loop in order to properly assess whether the complexity of the design is worth the complexity of the engineering solution. I’ve been thinking about this sort of thing for a really long time as it applies to my work in design systems — I have a feeling this issue stems from the fact that designers and developers are trading with different currencies. Designers generally care about the user experience above anything else while developers may prioritize the code under the hood, willing to over-engineer something for this one tiny detail. As Snook mentions later in his post, pattern libraries won’t solve this problem entirely: This is why it’s important to have these conversations during the design process. It’s important to understand what the priorities are...

Read More

Selectors That Depend on Layout

“Why the heck don’t we have ::first-column?” I heard someone ask that the other day and it’s a valid question. I’d even take that question further by asking about ::nth-column() or whatever else relates to CSS columns. We have stuff like ::first-letter and ::first-line. Why not others? There are many notable things missing from the “nth” crowd. Seven years ago, I wrote “A Call for ::nth-everything” and it included clear use cases like, perhaps, selecting the first two lines of a paragraph. I don’t know all the technical details of it all, but I know there are some fairly decent reasons why we don’t have all of these in CSS. Part of it is the difficulty of getting it specced (e.g. words and characters get tricky across written languages) and part of it is the difficulty of implementing them. What I just found out is that there is a FAQ document that explains! So, why don’t we have ::first-column? Because it’s a “selector that depends on layout”: This falls into a class of problems that unlikely to be solvable in CSS: selectors in general, and pseudo classes in particular, cannot depend on layout, because otherwise they could be used to modify layout in a way that made them no longer match, which would modify the layout back to where it was, so they match again, and we get stuck...

Read More
000webhost logo