Search
Weekly Platform News: CSS font-style: oblique, webhin browser extension, CSS Modules V1
9.8.2019
In this week's roundup, variable fonts get oblique, a new browser extension for linting, and the very first version of CSS Modules.
Use font-style: oblique on variable fonts
Some popular variable fonts have a 'wght' (weight) axis for displaying text at different font weights and a 'slnt' (slant)...
Design Principles for Developers: Processes and CSS Tips for Better Web Design
8.8.2019
It is technically true that anyone can cook. But there’s a difference between actually knowing how to prepare a delicious meal and hoping for the best as you throw a few ingredients in a pot. Just like web development, you might know the ingredients—<span>, background-color, .heading-1—but...
How to Become a Blockchain Developer
7.8.2019
Skilled blockchain developers are a scarce commodity, as precious as the bitcoins that reside on the distributed ledgers they maintain. Teach yourself one of the major blockchain programming languages and you’ll be set for life, though like anything worth having, this achievement won’t...
SSCCE
6.8.2019
You know what a "reduced test case" is, right? We've talked about it here. I imagine the concept is useful in many walks of life, but in the world of front-end development, you can think of it like:
A reduced test case is a demo/example page you create which reproduces the problem you are having...
Can you nest @media and @support queries?
5.8.2019
Yes, you can, and it doesn't really matter in what order. A CSS preprocessor is not required. It works in regular CSS.
This works:
@supports(--a: b) {
@media (min-width: 1px) {
body {
background: red;
}
}
}
And so does this, the reverse nesting of the above:
@media (min-width:...
Weekly Platform News: Preventing Image Loads with the Picture Element, the Web We Want, Svg Styles Are Not Scoped
1.8.2019
In this week's week roundup of browser news, a trick for loading images conditionally using the picture element, your chance to tell bowser vendors about the web you want, and the styles applied to inline SVG elements are, well, not scoped only to that SVG.
Let's turn to...
Making a Realistic Glass Effect with SVG
1.8.2019
I’m in love with SVG. Sure, the code can look dense and difficult at first, but you’ll see the beauty in the results when you get to know it. The bonus is that those results are in code, so it can be hooked up to a CMS. Your designers can rest easy knowing they don't have to reproduce an effect...
A More Accessible Portals Demo
31.7.2019
The point of the <portal> element (behind a flag in Chrome Canary) is that you can preload another whole page (like <iframe>), but then have APIs to animate it to the current page. So "Single Page App"-like functionality (SPA), but natively. I think that's pretty cool. I'm a fan...
How much specificity do @rules have, like @keyframes and @media?
31.7.2019
I got this question the other day. My first thought is: weird question! Specificity is about selectors, and at-rules are not selectors, so... irrelevant?
To prove that, we can use the same selector inside and outside of an at-rule and see if it seems to affect specificity.
body {
background:...
Intrinsically Responsive CSS Grid with minmax() and min()
31.7.2019
The most famous line of code to have come out of CSS grid so far is:
grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
Without any media queries, that will set up a grid container that has a flexible number of columns. The columns will stretch a little, until there is enough room...
The Simplest Way to Load CSS Asynchronously
30.7.2019
Scott Jehl:
One of the most impactful things we can do to improve page performance and resilience is to load CSS in a way that does not delay page rendering. That’s because by default, browsers will load external CSS synchronously—halting all page rendering while the CSS is downloaded...
Run useEffect Only Once
30.7.2019
React has a built-in hook called useEffect. Hooks are used in function components. The Class component comparison to useEffect are the methods componentDidMount, componentDidUpdate, and componentWillUnmount.
useEffect will run when the component renders, which might be more times than you think....
Datalist is for suggesting values without enforcing values
26.7.2019
Have you ever had a form that needed to accept a short, arbitrary bit of text? Like a name or whatever. That's exactly what <input type="text"> is for. There are lots of different input types (and modes!), and picking the right one is a great idea.
But this little story is about something...
Responsive Iframes
25.7.2019
Say you wanted to put the CSS-Tricks website in an <iframe>. You'd do that like this:
<iframe src="https://css-tricks.com"></iframe>
Without any other styling, you'd get a rectangle that is 300x150 pixels in size. That's not even in the User Agent stylesheet, it's just some...
Don’t comma-separate :focus-within if you need deep browser support
24.7.2019
I really like :focus-within. It's a super useful selector that allows you to essentially select a parent element when any of its children are in focus.
Say you wanted to reveal some extra stuff when a <div> is hovered...
div:hover {
.extra-stuff {
/* reveal it */
}
}
That's...
Pseudo Code
23.7.2019
Yonatan Doron wrote a post on Medium not long ago called "Art of Code — Why you should write more Pseudo Code." Love that title, as a fan of pseudo code myself. That is, writing "code" that describes something you want to do or communicate, but that isn't of any particular language and doesn't...
Zoom, CORS, and the Web
23.7.2019
It's sorta sad by funny that that big Zoom vulnerability thing was ultimately related to web technology and not really the app itself.
There is this idea of custom protocols or "URL schemes." So, like gittower:// or dropbox:// or whatever. A native app can register them, then URLs that hit them...
Code Formatting with Prettier in Visual Studio Code
23.7.2019
Formatting code consistently is a pain, especially when working on a team. The beauty of modern day web development is that the tooling has gotten so much better! In this article, we will look at s
CSS :not() with Multiple Classes
22.7.2019
Say you want to select an element when it doesn't have a certain class. That's what the :not() selector is for.
body:not(.home) {
}
But what if there are multiple classes you want to avoid?
There are no logical combinators with :not(), like and or or, but you can chain them, which...
Daimler to Produce Crypto Hard Wallet for Automotive Industry
22.7.2019
The wallet has implications for ride-sharing, autonomous vehicles, and on-the-go payments, according to the company