Search
Wide Gamut Color in CSS with Display-P3
31.3.2020
Here’s something I’d never heard of before: Display-P3 support in CSS Color Module Level 4 spec. This is a new color profile supported by certain displays and it introduces a much wider range of colors that we can choose from.
Right now the syntax looks something like this in CSS:
header...
CSS2JS
20.3.2020
To add inline styles on an element in JSX, you have to do it in this object syntax, like:
<div style={{
fontSize: 16,
marginBottom: "1rem"
}}Content
</div
That might look a little weird to us folks who are so used to the CSS syntax, where it is font-size (not fontSize), margin-bottom...
A Follow-Up to PHP Templating
28.2.2020
Not long ago, I posted about PHP templating in just PHP (which is basically HEREDOC syntax). I'm literally using that technique for some super basic templating I needed to do on this very WordPress site. The main pushback was that this kind of thing can be an XSS vulnerability. In my case, it's...
Animate SVG Path Changes in CSS
20.2.2020
Every once in a while I'm motivated to attempt to draw some shapes with <path>, the all-powerful drawing syntax of SVG. I only understand a fragment of what it all can do, but I know enough to be dangerous. All the straight-line syntax commands (like L) are pretty straightforward and I find...
Add Background Colors to SVGs Using the “rect” Element
20.2.2020
The advantages of using SVGs in web development are well known. SVGs are small in size, can be made quite accessible, are scalable while maintaining their quality, and can be animated. Still, there is a learning curve. Things, like the syntax of SVG, can be a little tricky and having to hand-alter...
While You Weren’t Looking, CSS Gradients Got Better
14.2.2020
One thing that caught my eye on the list of features for Lea Verou's conic-gradient() polyfill was the last item:
Supports double position syntax (two positions for the same color stop, as a shortcut for two consecutive color stops with the same color)
Surprisingly, I recently discovered most...
Why JavaScript is Eating HTML
13.2.2020
Web development is always changing. One trend in particular has become very popular lately, and it fundamentally goes against the conventional wisdom about how a web page should be made. It is exciting for some but frustrating for others, and the reasons for both are difficult to explain.
A...
Helping Browsers Optimize With The CSS Contain Property
10.2.2020
There is a growing number of things that we have to do to help the browser achieve for peak performance.
Responsive image syntax has several. For example, needing to tell the browser how large the image will be in our layout with the sizes attribute and how big the images are with w descriptors....
How to Modify Nodes in an Abstract Syntax Tree
26.12.2019
One of the more powerful concepts I've stumbled across recently is the idea of abstract syntax trees, or ASTs. If you've ever studied alchemy, you may recall that the whole motivation for alchemists was to discover some way to transform not-gold into gold through scientific or arcane methods.
ASTs...
Create a Static Site Using Angular & Scully
20.12.2019
The team at HeroDevs has just released the alpha version of Scully, a static site generator for Angular. That's right, Angular didn't have an intuitive way to create JAMstack applications before, but now it's possible!
Scully uses a node CLI application to run Angular schematics so you don’t have...
JavaScript ~~
9.12.2019
JavaScript is loaded with tiny syntax tricks to accomplish useful effects. For example, explore any codebase to see !! being used to convert a value to a boolean value. Have you seen ~~ before? Let’s have a look at what it does! We can employ ~~ to trigger a Math.floor operation with those...
Two-Value Display Syntax (and Sometimes Three)
8.11.2019
You know the single-value syntax: .thing { display: block; }. The value "block" being a single value. There are lots of single values for display. For example, inline-flex, which is like flex in that it becomse a flex container, but behaves like an inline-level element rather than a block-level...
(Why) Some HTML is “optional”
16.9.2019
Remy Sharp digs into the history of the web and describes why the <p> tag doesn’t need to be closed like this:
<p>Paragraphs don’t need to be closed
<p>Pretty weird, huh?
Remy writes:
Pre-DOM, pre-browsers, the world's first browser was being written by Sir...
Using Custom Properties to Wrangle Variations in Keyframe Animations
12.9.2019
Have you ever wondered how to customize CSS animations keyframes without using any preprocessor feature, like mixins? I keep reaching for preprocessors for this reason, but it would so nice to drop yet one more dependency and go with vanilla CSS.
Well, I found a way to account for variations within...
Some HTML is “Optional”
11.9.2019
There is a variety of HTML that you can just leave out of the source HTML and it's still valid markup.
Doesn't this look weird?
<p>Paragraph one.
<p>Paragraph two.
<p>Paragraph three.
It does to me, but the closing </p> tags are optional. The browser will detect...
CSS Animation Libraries
22.7.2019
There are an awful lot of libraries that want to help you animate things on the web. These aren't really libraries that help you with the syntax or the technology of animations, but rather are grab-and-use as-is libraries. Want to apply a class like "animate-flip-up" and watch an element, uhhh...
10 Interesting JavaScript and CSS Libraries for July 2019
8.7.2019
Better vanilla JS syntax, awesome CSS snippets and more cool libraries in our compilation for July 2019
Cashscript Is Coming, Bringing Ethereum-Like Smart Contracts to Bitcoin Cash
29.5.2019
On May 27, the analytics and data web portal Coin Dance announced the team has added the Cashscript project to the website’s development tracker. Cashscript is a high-level language that enables basic smart contract functionality on the Bitcoin Cash (BCH) network. Also Read: Crypto Assets...
Code as Documentation: New Strategies with CSS Grid
24.5.2019
I work for Supercool, a fast-moving design agency that makes custom built sites for arts clients, powered by the off-the-shelf system, Craft CMS; it's high-spec graphic design with relatively demanding typography and art direction. Over the past few months we’ve been moving to CSS grid. We’re...
JavaScript Detect Async Function
29.4.2019
JavaScript async/await has changed the landscape of how we code. We’re no longer stuck in callback or then hell, and our code can feel more “top down” again. Async functions require the following syntax: async function myFunction() { } To use await with a function, the function...