Styling the select element

Scott Jehl, from Filament Group:

The select element has long been difficult to style consistently across browsers. To avoid its shortcomings in the past, we have used workarounds like styling a parent element, adding pseudo-elements, and even using JavaScript to construct a select-like control out of different elements that are easier to style. But workarounds are hard to maintain and use, not to mention the accessibility challenges that custom elements bring.

Recently, we’d seen some articles suggest that things haven’t changed a great deal with select‘s styling limitations, but I decided to return to the problem and tinker with it myself to be sure. As it turns out, a reasonable set of styles can create a consistent and attractive select across new browsers, while remaining just fine in older ones too.

Thanks to the appearance CSS property they’ve removed the native styling and were able to inject their own, all whilst retaining the behavior and semantics of the select itself (unlike JS implementations and other attempts). The result is quite nice:

Styling a Select Like It’s 2019 →
Styling a Select Like It’s 2019 (Demo) →

Scribit, a robot that can draw on walls

Scribit is a vertical plotter that can draw any content sourced from the web – and update it in real time.

It is mounted on a wall using only 2 plugs and a wire in between. You send it an image from within the app and it will start drawing (with support for 4 colors at a time).

Shipping is expected June 2019, but like with all Kickstarter-funded projects that may vary 😉

Scribit →

Mozilla Hacks: Designing the Flexbox Inspector

With the upcoming release of Firefox 65 (due January 29tgh), its DevTools will sport a new shiny Flexbox Inspector.

The new Flexbox Inspector, created by Firefox DevTools, helps developers understand the sizing, positioning, and nesting of Flexbox elements.

Victoria Wang details how they UX challenges that came with this tool were tackled.

Built on the basic concepts of the CSS Grid Inspector, we sought to expand on the possibilities of what a design tool could be. I’m excited to share a behind-the-scenes look at the UX patterns and processes that drove our design forward.

Designing the Flexbox Inspector →

Speeding up Your PHPUnit tests

Some nice tips by Tim MacDonald on how to speed up your PHPUnit tests!

Having a fast test suite can be just as important as having a fast application. As a developer, getting feedback quickly about the state of your code allows for a much quicker development turnaround. Here we are going to run through some tips you can implement today to make your tests run faster.

Tips to Speed up Your Phpunit Tests →

(via Freek)

The ghosts of technology in today’s language

I like this post by Marcin Wichary in which he looks for remnant expressions in our language which are based on technologies that no longer exist, but that we still use. A typical example is “dialing a number”.

We dial a number — or dial someone — even though dials disappeared from phones decades ago. And we hang up even though there’s rarely a handset that actually needs to be hung up.

The ghosts of technology in today’s language →

Create beautiful menus on iOS with Codea’s iOS “Menu” pod

The folks who created Codea — an app for creative coding — recently adjusted it to make it also run on the iPhone. While Autolayout tackles most of the screen adapations, they were in need of menus.

I realised six months ago as I was using my Mac, using the menus, that I need these things — menus — in Codea. I was trying to solve a problem that has been solved for decades.

So I set out to make the best menus I could make for iOS.

The resulting code has been published as a separate pod.

pod 'Menu'

In to blogpost author Simeon Saëns focuses on the details that made it into this nice library. be sure to check out the videos too!

Menu Source (GitHub) →
The iOS Menu →
Detailing the iOS Menu →

Sidenote: Also see PanelKit and TabView, also two nice community-created UI components that found their birth in bigger projects that needed them (just like my own ansi-php package for example).

quicklink – Prefetch links (during idle time) based on what is in the user’s viewport

Great little piece of JavaScript which prefetches links, but only when the browser is idle (and when the user is on a “fast” connection). Uses the aforementioned Intersection Observer to detect which links are in-view.

Install it per NPM and call its quicklink(); method – for example after the DOM has loaded – to initialize the script.

Amongst ignore patterns, it’s also possible to define the origins which are allowed to be preloaded.

quicklink Source (GitHub) →

@dailyhomealone, an Instagram bot posting one frame from Home Alone per day

Tim Broddin has created @dailyhomealone, an Instagram bot which does a daily post containing one frame – taken at a 5 seconds interval – from Home Alone.

Along with that he has done a writeup on how he created the bot. This paragraph resonated quite well with me:

A lot has happened to the openness of the Internet [since the last time I wrote a bot] and it’s quite difficult to create a bot nowadays. Twitter has limited it’s API capabilities (no more realtime), and in order to post you need their permission. Instagram has ditched its API and replaced it with something horrible for marketeers and other scumbags. And since Facebook leaked all of your data, they’ve closed their doors and now require you to sign contracts in order to do anything fun.

Eventually he made use of some private Instagram APIs to do the daily posts. Using Amazon Rekognition he also auto-tags each post.

@dailyhomealone on Instagram →
Creating a Home Alone Instagram bot →
dailyhomelone Source Code (GitHub) →

I found this Home Alone themede ad for Google Assistant very amusing:

Easily create iOS Mockups (photo/ video) with Design Camera for macOS

Design Camera is an app for your Mac that lets you create, capture, and animate 3D mockups for your digital designs in a matter of seconds.

Using just a few clicks – using screenshots taken in the iPhone Simulator – I created this render/mockup:

Video and more input formats – such as Sketch – also supported … neat!

Design Camera for macOS →

What’s new in the upcoming PHP 7.4?

Good overview by Brendt on the new features that will be landing in PHP 7.4, which is due somewhere December 2019.

I’m especially looking forward to Typed properties.

New in PHP 7.4 →

💭 One thing I personally find missing in PHP’s typehinting, is a way to typehint array contents — e.g. “I’d like an array of Foo‘s”. As posted before you could leverage the variadic function syntax, but that only works if all arguments of the function are of the same type.

The addition of a [] suffix on the hinted type – like Java has – could potentially solve this all:

// ⚠️ Fictional syntax! Does not work
function workWithFoo(Foo[] $foos, string $otherArgument) : void {
    foreach ($foos as $foo) {
        // etc.
    }
}

In the mean time I resort to hackery like this (src):

// Definition
class ArrayOfFoo extends \ArrayObject {
    public function offsetSet($key, $val) {
        if ($val instanceof Foo) {
            return parent::offsetSet($key, $val);
        }
        throw new \InvalidArgumentException('Value must be a Foo');
    }
}

// Usage
function workWithFoo(ArrayOfFoo $foos, string $otherArgument) : void {
    foreach ($foos as $foo) {
        // etc.
    }
}

I anyone has a better way to tackle this, feel free to enlighten me by leaving a comment.