> All in One 586: November 2020

Ads

Monday, November 30, 2020

Mostly Clear today!



With a high of F and a low of 22F. Currently, it's 24F and Clear outside.

Current wind speeds: 7 from the Southwest

Pollen: 0

Sunrise: November 30, 2020 at 07:51PM

Sunset: December 1, 2020 at 05:29AM

UV index: 0

Humidity: 35%

via https://ift.tt/2livfew

December 1, 2020 at 10:00AM

EV bus and truck maker The Lion Electric to take SPAC route to public markets

Canadian electric truck and bus manufacturer The Lion Electric Company said Monday it plans to become a publicly traded company via a merger with special purpose acquisition company Northern Genesis Acquisition Corp.

The combined company, which will be listed on the New York Stock Exchange, will have a valuation of $1.9 billion. The companies raised $200 million in private investment in public equity, or PIPE, and hold about $320 million in cash proceeds.

The deal is the latest example of an electric automaker opting to go public via a SPAC merger in an aim to access the level of capital needed to become a high-volume vehicle manufacturer. Arrival, Canoo, Fisker, Lordstown Motors and Nikola Corp. have all announced SPAC mergers in 2020.

In Lion’s case, the combined net cash will be used to fund the company’s growth, notably the planned construction of a U.S.-based factory and to further develop its advanced battery systems. Lion is evaluating more than 10 potential brownfield plant sites in nine states, including California, Illinois, Indiana, Michigan, New York, Ohio, Oregon, Pennsylvania, Washington and Wisconsin. The company told TechCrunch it plans to pick a site and complete its industrialization plan by the end of the year. Production at this yet-to-be named factory is expected to start in the beginning of 2023.

Lion is already producing all-electric medium and heavy-duty urban trucks and buses at a 2,500-vehicle-per-year manufacturing facility. Some 300 vehicles are on the road today and the company has plans to deliver 650 trucks and buses in 2021. It even landed a contract with Amazon to supply the e-commerce giant with 10 electric trucks for its “middle mile” operations.

Completion of the proposed transaction is expected to occur in the first quarter of 2021. Lion is expected to be listed on the NYSE under the new ticker symbol “LEV.” Lion’s CEO and founder Marc Bedard will continue in his role. The combined company will have a board of directors consisting of nine directors, including Bedard, Pierre Larochelle from Power Sustainable as chairman, and five other existing Lion board members, as well as Ian Robertson and Chris Jarratt, who are co-founders of Algonquin Power & Utilities Corp.



from Amazon – TechCrunch https://ift.tt/3oaLDZk
via IFTTT

Native CSS Masonry Layout In CSS Grid

Rachel Andrew introducing the fact that masonry layout is going to be a thing in native CSS via CSS grid layout. The thing with masonry is that we can already do it for the most part, but there is just one thing that makes it hard: doing the vertical-staggering and having a left-to-right source order. So that’s what this new ability will solve in addition to it just being less hacky in general.

You can already test a partial implementation in Firefox Nightly by enabling layout.css.grid-template-masonry-value.enabled.

.container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: masonry;
}

I like the grid-template-rows: masonry; syntax because I think it clearly communicates: “You aren’t setting these rows. In fact, there aren’t even really rows at all anymore, we’ll take care of that.” Which I guess means there are now rows to inherit in subgrid, which also makes sense.


The post Native CSS Masonry Layout In CSS Grid appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.



from CSS-Tricks https://ift.tt/2JzUfd2
via IFTTT

EV bus and truck maker The Lion Electric to take SPAC route to public markets

Canadian electric truck and bus manufacturer The Lion Electric Company said Monday it plans to become a publicly traded company via a merger with special purpose acquisition company Northern Genesis Acquisition Corp.

The combined company, which will be listed on the New York Stock Exchange, will have a valuation of $1.9 billion. The companies raised $200 million in private investment in public equity, or PIPE, and hold about $320 million in cash proceeds.

The deal is the latest example of an electric automaker opting to go public via a SPAC merger in an aim to access the level of capital needed to become a high-volume vehicle manufacturer. Arrival, Canoo, Fisker, Lordstown Motors and Nikola Corp. have all announced SPAC mergers in 2020.

In Lion’s case, the combined net cash will be used to fund the company’s growth, notably the planned construction of a U.S.-based factory and to further develop its advanced battery systems. Lion is evaluating more than 10 potential brownfield plant sites in nine states, including California, Illinois, Indiana, Michigan, New York, Ohio, Oregon, Pennsylvania, Washington and Wisconsin. The company told TechCrunch it plans to pick a site and complete its industrialization plan by the end of the year. Production at this yet-to-be named factory is expected to start in the beginning of 2023.

Lion is already producing all-electric medium and heavy-duty urban trucks and buses at a 2,500-vehicle-per-year manufacturing facility. Some 300 vehicles are on the road today and the company has plans to deliver 650 trucks and buses in 2021. It even landed a contract with Amazon to supply the e-commerce giant with 10 electric trucks for its “middle mile” operations.

Completion of the proposed transaction is expected to occur in the first quarter of 2021. Lion is expected to be listed on the NYSE under the new ticker symbol “LEV.” Lion’s CEO and founder Marc Bedard will continue in his role. The combined company will have a board of directors consisting of nine directors, including Bedard, Pierre Larochelle from Power Sustainable as chairman, and five other existing Lion board members, as well as Ian Robertson and Chris Jarratt, who are co-founders of Algonquin Power & Utilities Corp.



from Amazon – TechCrunch https://ift.tt/3oaLDZk
via IFTTT

Super Tiny Icons

A bunch of SVG icons (of popular things) all under 1KB. SVG is awesome for golfing.

I was going to add a CodePen logo but there is already one in there at 375 Bytes. I’ve got one at 208 Bytes, based on a logo update David DeSandro did for us a couple years back.

Direct Link to ArticlePermalink


The post Super Tiny Icons appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.



from CSS-Tricks https://ift.tt/2hR4aJT
via IFTTT

Lots of Ways to Use Math.random() in JavaScript

Math.random() is an API in JavaScript. It is a function that gives you a random number. The number returned will be between 0 (inclusive, as in, it’s possible for an actual 0 to be returned) and 1 (exclusive, as in, it’s not possible for an actual 1 to be returned).

Math.random(); // returns a random number lower than 1

This is incredibly useful for gaming, animations, randomized data, generative art, random text generation, and more! It can be used for web development, mobile applications, computer programs, and video games.

Whenever we need randomization in our work, we can use this function! Let’s look at eight different ways we can use it. These examples are all from different authors doing something interesting with this API.

Animation

To spawn an object and animate it, we use Math.random. The neon lines form spontaneous hexagons but randomization is also in its generative sparks. 

Computer-generated music

This program takes the traditional melody of “Auld Lang Syne” and plays random notes from it in piano. A change package is created from the count data and a random number is generated to select a value. The octave is also randomly selected.

Display a random image

Images are stored in an array. A number is generated and multiplied by the number of images in the array via array.length. Then Math.floor rounds the value to a round number and sets the image src in the HTML when the page is loaded or the button is clicked.

Random background color

This is where the magic happens:

const random = (min, max) => {
  return Math.floor(Math.random() * (max - min + 1)) + min;
}

The first line of code randomly shuffles the array and the second line returns a random umber between 0 and 10. In the example of a random color background, the range of colors and specifics such as hues, saturations, and shades can be set. 

For another method for generating a random hex color, check out this article by Chris Coyer. 

Generative art

In this morphing fractal curve, Math.random is used twice to set the colors for the gradient and once more for the max radius of the curves. This is a great way to construct an entirely new appearance with every iteration!

Word generator 

We replace the header with a randomly selected word from an array using Math.random:

var word = words[Math.floor(Math.random() * words.length)] + "!";

This is a lot like the random image example — the perfect sort of practice for beginners! 

API key generator

Here’s a super real-world practical use case for random numbers! The demo generates 16 random numbers to create a universally unique identifier (UUID) that can be used as a key that provides access to an API.

Text scramble

A few phrases are stored and displayed in sequence, separated by an animation that appears to scramble the letters with random characters between phrases that are selected by Math.random.

Rock Paper Scissors

In this childhood classic game of Rock Paper Scissors, Math.random is used to generate a randomized move for the computer playing as the opponent. It makes a pick from the three available moves.

Strong Password Generator

This password generator uses Math.random to get a password array filled with uppercase and lowercase letters then adds random digits to the generated password. This is another great practical example!

A couple of notes…

It’s possible you have questions after seeing Math.random in these examples. There are a couple I see come up often…

Is Math.random() really random? 

Not exactly. Math.random() returns a pseudo-random number. This algorithm is called a pseudo-random number generator (or PRNG). This means its randomization can be reproduced under certain circumstances. 

The randomization is based on the algorithm xorshift128+, which is likely running on your browser.

So, it’s random-ish.

How do you handle repeated values?

There are many methods to achieve unique values without repetition. The Fisher-Yates is one great way to prevent getting the same number twice by shuffling the sequence. Math.random will select a value from the shuffled array of a finite sequence demonstrated by the code snippet below.

function shuffle (array) {
  var i = 0
    , j = 0
    , temp = null

  for (i = array.length - 1; i > 0; i -= 1) {
    j = Math.floor(Math.random() * (i + 1))
    temp = array[i]
    array[i] = array[j]
    array[j] = temp
  }
}

Is Math.random() the same as WebCrypto? 

As you’ve seen from this article, Math.random() is awesome! However, if you dealing with sensitive applications and need a more secure method of randomization, I’d recommend WebCrypto. Reasons you may want to use WebCrypto include temporary verification codes, random password generation, randomized lottery numbers, etc. 

If you need randomization for the purposes of cybersecurity, cryptography, or statistics ,  use the function window.crypto.getRandomValues and check out Mozilla’s documentation on the WebCrypto API.


The post Lots of Ways to Use Math.random() in JavaScript appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.



from CSS-Tricks https://ift.tt/3lnobpJ
via IFTTT

Sunday, November 29, 2020

Clear today!



With a high of F and a low of 16F. Currently, it's 16F and Clear outside.

Current wind speeds: 6 from the West

Pollen: 0

Sunrise: November 29, 2020 at 07:50PM

Sunset: November 30, 2020 at 05:29AM

UV index: 0

Humidity: 65%

via https://ift.tt/2livfew

November 30, 2020 at 10:00AM

Saturday, November 28, 2020

Clear/Wind today!



With a high of F and a low of 24F. Currently, it's 30F and Clear outside.

Current wind speeds: 13 from the Southwest

Pollen: 0

Sunrise: November 28, 2020 at 07:49PM

Sunset: November 29, 2020 at 05:29AM

UV index: 0

Humidity: 84%

via https://ift.tt/2livfew

November 29, 2020 at 10:00AM

Friday, November 27, 2020

Clear today!



With a high of F and a low of 22F. Currently, it's 26F and Clear outside.

Current wind speeds: 11 from the Southwest

Pollen: 0

Sunrise: November 27, 2020 at 07:48PM

Sunset: November 28, 2020 at 05:30AM

UV index: 0

Humidity: 65%

via https://ift.tt/2livfew

November 28, 2020 at 10:00AM

Thursday, November 26, 2020

Partly Cloudy today!



With a high of F and a low of 19F. Currently, it's 26F and Fair outside.

Current wind speeds: 7 from the North

Pollen: 0

Sunrise: November 26, 2020 at 07:47PM

Sunset: November 27, 2020 at 05:30AM

UV index: 0

Humidity: 83%

via https://ift.tt/2livfew

November 27, 2020 at 10:00AM

Exploring What the Details and Summary Elements Can Do

Gosh bless the

element. Toss some content inside it and you have an accessible expand-for-more interaction with just about zero work.

See the Pen Simple details. by Chris Coyier (@chriscoyier) on CodePen.

Toss a

in there to customize what the expander text says.

See the Pen Multiple Details/Summary by Chris Coyier (@chriscoyier) on CodePen.

Works great for FAQs.

There is really no limit to how you can style them. If you don’t like the default focus ring, you can remove that, but make sure to put some kind of styling back.

Here I’ve used a header element for each expandable section, which has a focus state that mimics other interactive elements on the page.

The only browser that doesn’t support this are the Microsoft ones (and Opera Mini which makes sense—it doesn’t really do interactive).

This browser support data is from Caniuse, which has more detail. A number indicates that browser supports the feature at that version and up.

Desktop

Chrome Firefox IE Edge Safari
12 49 No 79 6

Mobile / Tablet

Android Chrome Android Firefox Android iOS Safari
86 82 4 6.0-6.1

But even then, it’s just like all the sections are opened, so it’s not a huge deal:

Wanna style that default triangle? Strangely enough, the standard way to do that is through the list-style properties. But Blink-based browsers haven’t caught up to that yet, so they have a proprietary way to do it. They can be combined though. Here’s an example of replacing it with an image:

summary {
  list-style-image: url(right-arrow.svg);
}

summary::-webkit-details-marker {
  background: url(right-arrow.svg);
  color: transparent;
}

See the Pen Custom Markers on Details/Summary by Chris Coyier (@chriscoyier) on CodePen.

Unfortunately, they don’t turn, and there is no way to animate the default triangle either. One idea might be to target the :focus state and swap backgrounds:

See the Pen Custom Markers on Details/Summary by Geoff Graham (@geoffgraham) on CodePen.

But that seems to be limited to WebKit and Blink and, even then, the arrow will return once the item is out of focus even if the item is still expanded.


The post Exploring What the Details and Summary Elements Can Do appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.



from CSS-Tricks https://ift.tt/2V6OXYY
via IFTTT

Three Things You Didn’t Know About AVIF

AVIF, the file format based on the AV1 video codec, is the latest addition to the next-gen image formats. Early reports and comparisons show good results compared to JPEG and WebP. However, even if browser support is good, AVIF is still on the bleeding edge in regards to encoding and decoding. Encoding, decoding, settings and parameters has been well discussed elsewhere. 

No doubt, AVIF images generate a smaller payload and are nice looking. In this post, we’ll take a closer look at issues to be aware or before you go all in on AVIF.

1. WebP is Better for Thumbnails

One interesting observation is that for small dimension images, WebP will produce lighter payload images than AVIF.

It’s probably possible to explain why, and tune the encoder to address this case. However, that is not an option for most people. Most people would probably rely on an image optimizer like squoosh.app or an image CDN like ImageEngine. The below comparison uses exactly these two alternatives for AVIF conversion. 

We see that WebP will generally produce images with a higher file size than AVIF. On larger dimension images, ImageEngine performs significantly better than squoosh.app.

Now, to the interesting observation. On images around 100px × 100px squoosh.app passes ImageEngine on effectiveness, but then also WebP catches up and for a 80px x 80px image. WebP is actually the most effective image measured in file size. 

The test performs relatively consistently on different types of images. For this illustration, this image from Picsum is used.

Pixels Original JPEG (bytes) Optimized WebP (bytes) ImageEngine AVIF (bytes) squoosh.app AVIF (bytes)
50 1,475 598 888 687
80 2,090 1,076 1,234 1,070
110 3,022 1,716 1,592 1,580
150 4,457 2,808 2,153 2,275
170 5,300 3,224 2,450 2,670
230 7,792 4,886 3,189 3,900
290 10,895 6,774 4,056 5,130

2. AVIF Might Not Be the Best for Product Images with High Entropy

Typically, a product page consists of images of the product, and when a user’s mouse hovers over or clicks on the product image, it zooms in to offer a closer look at the details.

It is worth noting that AVIF will in certain cases reduce the level of detail, or perceived sharpness, of the image when zoomed in. Especially on a typical product image where the background is blurred or has low entropy while foreground, and product, has more detail and possibly higher entropy.

Below is a zoomed in portion of a bigger product image (JPEG, AVIF) which clearly illustrates the difference between a regularly optimized JPEG versus an AVIF image optimized by squoosh.app.


The AVIF is indeed much lighter than the JPEG, but in this case the trade off between visual quality and lower file size has gone too far. This effect will not be as perceptible for all types of images, and therefore will be difficult to proactively troubleshoot in an automated build process that relies on responsive images syntax for format selection.

Moreover, unlike JPEG, AVIF does not support progressive rendering. For a typical product detail page, progressive rendering might provide a killer feature to improve key metrics like Largest Contentful Paint and other Core Web Vitals metrics. Even if a JPEG takes a little bit longer time to download due to its larger file size compared to AVIF, chances are that it will start rendering sooner than an AVIF thanks to its progressive rendering mechanism. This case is well illustrated by this video from Jake Achibald.

3. JPEG 2000 is Giving AVIF Tough Competition

The key selling point of AVIF is its extremely low file size relative to an acceptable visual image quality. Early blogs and reports have been focusing on this. However, JPEG2000 (or JP2) may in some cases be a better tool for the job. JPEG2000 is a relatively old file format and does not get the same level of attention as AVIF, even if the Apple side of the universe already supports JPEG2000.

To illustrate, let’s look at this adorable puppy. The AVIF file size optimized by squoosh.app is 27.9 KB with default settings. Converting the image to JPEG2000, again using ImageEngine, the file size is 26.7 KB. Not much difference, but enough to illustrate the case.

What about the visual quality? DSSIM is a popular way to compare how visually similar an image is to the original image. The DSSIM metric compares the original image to a converted file, with a lower value indicating better quality. Losslessly converting the AVIF and JPEG2000 version to PNG, the DSSIM score is like this:

DSSIM (0 = equal to original) Bytes
JPEG2000 0.019 26.7 KB
AVIF 0.012 27.9 KB

AVIF has slightly better DSSIM but hardly visible to the human eye.

Right Tool for the Job

The key takeaway from this article is that AVIF is hardly the “silver bullet,” or the one image format to rule them all. First of all, it is still very early in the development of both encoders and decoders. In addition, AVIF is yet another format to manage. Like Jake Archibald also concludes in his article, offering 3+ versions of each image on your webpage is a bit of a pain unless the entire workflow (resize, compress, convert, select, deliver) is all automated.

Also, like we’ve seen, just because a browser supports AVIF, it doesn’t mean that it is the best choice for your users.

Using responsive images and adding AVIF to the list of image formats to pre-create is better than not considering AVIF at all. A potential challenge is that the browser will then pick AVIF if it’s supported regardless of whether AVIF is the right tool or not.

However, using an image CDN like ImageEngine, will to a greater extent be able to dynamically choose between supported formats and make a qualified guess whether WEBP, JPEG2000 or AVIF will give the best user experience. Using an image CDN to automate the image optimization process will take into account browser compatibility, image payload size and visual quality.


The post Three Things You Didn’t Know About AVIF appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.



from CSS-Tricks https://ift.tt/378cNcp
via IFTTT

Wednesday, November 25, 2020

Despite pandemic, forecasts predict US online holiday sales increase of 20%-30% or more

Strong e-commerce sales are predicted to help lift overall holiday retail spending in the U.S., according to forecasts released today by the National Retail Federation (NRF) and eMarketer. Both firms expect to see overall retail sales growth during November and December, though the market may be impacted by slowing brick-and-mortar sales.

Of the two, NRF had the more optimistic forecast. It estimates U.S. holiday sales during November and December will increase between 3.6% and 5.2% year-over-year, for a total between $755.3 billion and $766.7 billion. That’s compared with a 4% increase in 2019 to $729.1 billion, and an average of a 3.5% increase over the past five years.

Image Credits: NRF

Growth will come from online and other non-store sales, which are included in the total, which will increase between 20% and 30% to reach between $202.5 billion and $218.4 billion. That’s up from $168.7 billion last year.

NRF’s takeaway is that consumers are willing to spend — perhaps because of the challenging year that 2020 has been, rather than despite it.

“After all they’ve been through, we think there’s going to be a psychological factor that they owe it to themselves and their families to have a better-than-normal holiday,” noted NRF Chief Economist Jack Kleinhenz. “There are risks to the economy if the virus continues to spread, but as long as consumers remain confident and upbeat, they will spend for the holiday season,” he added.

The firm also noted Americans may have reduced their spending in other categories, like personal services, travel and entertainment due to the pandemic, which could increase the money they have for retail spending.

EMarketer, on the other hand, paints a less rosy picture when it comes to overall sales.

The firm predicts that total holiday season retail sales will see the lowest growth rate at just 0.9% year-over-year. This growth will come from the e-commerce sector, which will see its highest growth rate — 35.8% — since the firm began tracking retail sales in 2008. Brick-and-mortar sales, on the other hand, will decline 4.7%.

The discrepancy between these two firms’ estimates have to do with how they calculate “retail sales.”

EMarketer’s estimates include auto and gasoline sales, but exclude restaurants, travel and event sales. NRF’s figures, on the other hand, exclude auto, gasoline and restaurants.

However, both agree on an e-commerce surge. NRF notes online sales were already up 36.7% year-over-year in the third quarter — in part, due to early holiday shopping. This year, some 42% of consumers had started shopping earlier than usual, it recently found. Plus, retail sales were up 10.6% in October 2020 versus October 2019, in aggregate, its forecast noted.

But whether it’s 20% to 30% growth or 35.8%, depending on the firm, it’s clear e-commerce is saving the day here.

NRF also expects seasonal hiring to be in line with recent years, as retailers hire between 475,000 and 575,000 seasonal workers compared with 562,000 in 2019. Some of that hiring may have already taken place in October, due to early shopping, it said.

Though Black Friday may not see the same levels of in-person shopping as in years past, brick-and-mortar retailers have made it easier to shop digitally, then either have items shipped home, picked up in-store, or even curbside. Outside of Amazon, Walmart and Target have particularly benefited from investments in e-commerce, as both retailers easily beat Wall St. expectations in their latest earnings reports, released just ahead of the holiday quarter.

Online, however, Cyber Monday will continue to rule, however, eMarketer says.

Image Credits: eMarketer

Of the five big online shopping days in 2020, eMarketer says Cyber Monday will again beat out Black Friday in terms of overall e-commerce sales, at $12.89 billion compared with Black Friday’s $10.20 billion. But Thanksgiving Day will see the most year-over-year growth in e-commerce sales, at 49.5%, followed by Black Friday, Small Business Saturday, Cyber Sunday and Cyber Monday.

Image Credits: eMarketer

In a mobile forecast, analytics firm App Annie predicted Americans would spend over 110 million hours in shopping apps on Android devices during the two-week period consisting of Black Friday and Cyber Monday weeks. It noted the pandemic had already accelerated mobile device usage to 4 hours, 20 minutes per day, and Americans spent over 61 million hours shopping during the week of Prime Day.



from Amazon – TechCrunch https://ift.tt/2HsqMRo
via IFTTT

Clear today!



With a high of F and a low of 23F. Currently, it's 31F and Clear outside.

Current wind speeds: 10 from the Southwest

Pollen: 0

Sunrise: November 25, 2020 at 07:46PM

Sunset: November 26, 2020 at 05:31AM

UV index: 0

Humidity: 67%

via https://ift.tt/2livfew

November 26, 2020 at 10:01AM

Daily Crunch: Amazon Web Services stumble

An Amazon Web Services outage has a wide effect, Salesforce might be buying Slack and Pinterest tests new support for virtual events. This is your Daily Crunch for November 25, 2020.

And for those of you who celebrate Thanksgiving: Enjoy! There will be no newsletter tomorrow, and then Darrell Etherington will be filling in for me on Friday.

The big story: Amazon Web Services stumble

Amazon Web Services began experiencing issues earlier today, which caused issues for sites and services that rely on its cloud infrastructure — as writer Zack Whittaker discovered when he tried to use his Roomba.

Amazon said the issue was largely localized to North America, and that it was working on a resolution. Meanwhile, a number of other companies, such as Adobe and Roku, have pointed to the AWS outage as the reason for their own service issues.

The tech giants

Slack’s stock climbs on possible Salesforce acquisition — News that Salesforce is interested in buying Slack sent shares of the smaller firm sharply higher today.

Pinterest tests online events with dedicated ‘class communities’ — The company has been spotted testing a new feature that allows users to sign up for Zoom classes through Pinterest.

France starts collecting tax on tech giants — This tax applies to companies that generate more than €750 million in revenue globally and €25 million in France, and that operate either a marketplace or an ad business.

Startups, funding and venture capital

Tiger Global invests in India’s Unacademy at $2B valuation — Unacademy helps students prepare for competitive exams to get into college.

WeGift, the ‘incentive marketing’ platform, collects $8M in new funding — Founded in 2016, WeGift wants to digitize the $700 billion rewards and incentives industry.

Cast.ai nabs $7.7M seed to remove barriers between public clouds — The company was started with the idea that developers should be able to get the best of each of the public clouds without being locked in.

Advice and analysis from Extra Crunch

Insurtech’s big year gets bigger as Metromile looks to go public — Metromile, a startup competing in the auto insurance market, is going public via SPAC.

Join us for a live Q&A with Sapphire’s Jai Das on Tuesday at 2 pm EST/11 am PST — Das has invested in companies like MuleSoft, Alteryx, Square and Sumo Logic.

(Extra Crunch is our membership program, which aims to democratize information about startups. You can sign up here.)

Everything else

Gift Guide: Smart exercise gear to hunker down and get fit with — Smart exercise and health gear is smarter than ever.

Instead of yule log, watch this interactive dumpster fire because 2020 — Sure, why not.

The Daily Crunch is TechCrunch’s roundup of our biggest and most important stories. If you’d like to get this delivered to your inbox every day at around 3pm Pacific, you can subscribe here.



from Amazon – TechCrunch https://ift.tt/39fBCpn
via IFTTT

Tailwind versus BEM

Some really refreshing technological comparison writing from Eric Bailey. Like, ya know, everything in life, we don’t have to hate or love everything. Baby bear thinking, I like to say. There are benefits and drawbacks. Every single bullet point here is well-considered and valid. I really like the first in each section, so I’ll quote those as a taste here:

Tailwind Benefit: “The utility CSS approach creates an API-style approach to thinking about CSS, which helps many developers work with it.”

Tailwind Drawback: “You need to learn Tailwind class names in addition to learning CSS property names to figure out the visual styling you want. Tailwind is reliant on, and will be outlived by CSS, so it is more long-term beneficial to focus on CSS’ capabilities directly.”

BEM Benefit: “BEM will allow you to describe any user interface component you can dream up in a flexible, extensible way. As it is an approach to encapsulate the full range of CSS properties, it will allow you to style things Tailwind simply does not have classes for—think highly art directed experiences.”

BEM Drawback: “BEM runs full-tilt into one of the hardest problems in computer science—naming things. You need to not only describe your component, but also all its constituent parts and their states.”


And remember, these certainly aren’t the only two choices on the block. I covered my thoughts on some other approaches here.

Direct Link to ArticlePermalink


The post Tailwind versus BEM appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.



from CSS-Tricks https://ift.tt/2Gc3O0m
via IFTTT

Amazon Web Services outage takes a portion of the internet down with it

Amazon Web Services is currently having an outage, taking a chunk of the internet down with it.

Several AWS services were experiencing problems as of early Wednesday, according to its status page. That means any app, site or service that relies on AWS might also be down, too. (As I found out the hard way this morning when my Roomba refused to connect.)

Amazon says the issue is largely localized to North America. The company didn’t give a reason for the outage, only that it was experiencing increased error rates and that it was working on a resolution. The irony is that the outage is also affecting the company’s “ability to post updates to the Service Health Dashboard,” so not even Amazon is immune from its own downtime.

So far a number of companies that rely on AWS have tweeted out that they’re experiencing issues as a result, including Adobe and Roku.

We’ll keep you updated as this outage continues. On the bright side TechCrunch is still up, so here are a few things to read.

Extra Crunch:



from Amazon – TechCrunch https://ift.tt/3nYDcAi
via IFTTT

Considerations for Making a CSS Framework

Around eight months ago, I started building a framework which would eventually go on to become Halfmoon. I made a post on this very website announcing the launch of the very first version. Halfmoon has been billed as a Bootstrap alternative with a built-in dark mode feature, that is especially good when it comes to building dashboards and tools. All of this still applies to the framework.

However, today I would like to talk about an area of the framework that is a bit understated. I believe our industry as a whole seriously underestimates the value of customization and user personalization, i.e. users being able to set their own design preferences. Chris has written before about knowing who a design system is made for, pointing out a spectrum of flexibility depending on who a system is meant to help.

But it’s more than design systems. Let’s talk about how Halfmoon addresses these issues because they’re important considerations for knowing which framework works best for your specific needs.

Dashboard built using Halfmoon

Who is Halfmoon for?

Before diving in, let’s address an important question: Is Halfmoon the right framework for you? Here’s a list of questions to help you answer that:

  • Are you building a dashboard, tool, or even a documentation website? Halfmoon has many unique components and features that are specific to these use cases.
  • Are you familiar with Bootstrap’s class names, but wish that the design was a bit more premium-looking?
  • Does your users want or expect a dark mode on your website?
  • Do you dislike dependencies? Halfmoon does not use jQuery, and also has no build process involving CSS preprocessors. Everything is pure, vanilla CSS and JavaScript.
  • Are you tired of dealing with complex build systems and front-end tooling? This ties in to the previous point. Personally, I find it difficult to deal with front-end tooling and build processes. As mentioned above, Halfmoon has no build process, so you just pull in the files (local, CDN, or npm), and start building.

If you answered yes to any (or all) of these questions, you should probably give Halfmoon a try. It is important to note however, that Halfmoon is not a UI component library for React/Vue/Angular, so you shouldn’t go into it expecting that. Moreover, if you are more fond of purely utility driven development, then Tailwind CSS is a better option for you. When it comes to CSS utilities, Halfmoon takes a middle of the road approach – there are utilities plus semantic classes for common components.

Using CSS custom properties

First, let’s get the easy stuff out of the way. CSS custom properties are incredible, and I expect them to completely replace preprocessor variables in the future. Browser support is already at a solid ~96%, and with Internet Explorer being phased out by Microsoft, they are expected to become a standard feature.

Halfmoon is built entirely using CSS variables because they provide a huge degree of customization. Now, you might immediately think that all this means is that there are a few custom properties for colors sprinkled in there, but it’s more than that. In fact, there are over 1,500 global variables in Halfmoon. Almost everything can be customized by overriding a property. Here’s a nifty example from the docs:

Halfmoon customization using CSS variables
Swapping out a few custom property values opens up a ton of possibilities in Halfmoon, whether it’s theming things for a brand, or tweaking the UI to get just the right look.

That’s what we’re talking about here when it comes to customization: does the system still stand up and work well if the person using it overrides anything. I have written extensively about this (and much more) in the official Halfmoon docs page.

Variables aren’t a new concept to frameworks. Many frameworks actually use Sass or Less variables and have done so for quite a while. That’s still a good and effective way to establish a customizable experience. But at the same time, those will lock into a preprocessor (which, again, doesn’t have to be a bad thing). By relying instead on CSS custom properties — and variable-izing all the things — we are relying on native CSS, and that doesn’t require any sort of build dependency. So, not only can custom properties make it easier to customize a framework, but they are much more flexible in terms of the tech stack being used.

There is a balance to be had. I know I suggested creating variables for everything, but it can be equally tough to manage and maintain scores and scores of variables (just like anything else in the codebase). So, lean heavily on variables to make a framework or design system more flexible, but also be mindful of how much flexibility you need to provide and whether adding another variable is part of that scope.

Deciding what components to include

When it comes to building a CSS framework, deciding what components to include is a big part of that ordeal. Of course, for a developer working on a passion project, you want to include everything. But that is simply not feasible, so a few decisions were made on my part.

As of right now, Halfmoon has most of the components you can find in similar frameworks such as Bootstrap or Bulma. These frameworks are great and widely used, so they are a good frame of reference. However, as I have mentioned already, a unique thing about Halfmoon is the focus on building tools and dashboards on the web. This niche, if you could call it that, has led me to build some unique components and features:

  • 5 different types of sidebars, with built-in toggle and overlay handlers. Sidebars are very important for most dashboards and tools (and a pain to get right), so this was a no brainer.
  • 2 different types of navbars. There is one that sticks to the bottom of the page, which can be used to great effect for action buttons. Think about the actions that pop up when you select items on data-table. You could place those action buttons here.
  • Omni-directional dropdowns (with 12 different placements, 3 for each direction).
  • Beautiful form components.
  • Built-in keyboard shortcut system, with an easy way to declare new ones for your tool.
  • Tons of utilities. Of course, this is not comparable to Tailwind CSS, but Halfmoon has enough responsive utility classes to handle a lot of use cases right out of the box.

Moreover, the built-in dark mode, huge customizability, and the standard look and feel to the components, should all work together to make Halfmoon a great tool for building web tools and dashboards. And I am hopefully nowhere close to being done! The next updates will bring in a form validator (demo video), more form components, multi-select component, date and time picker, data-table component, etc.

So what is exactly missing from Halfmoon? Well the most obvious ones are tabs, list group, and spinners. But all of these are planned to be added in v1.2.0, which is the next update. There are also other missing components such as carousels, tree navigation, avatars, etc, which are slightly out of scope.

Providing user preferences

Giving end users the ability to set their preferences is often overlooked by frameworks. Things like setting the font size of an article, or whether to use a dark or light theme. In some ways, it’s sort of funny, because the web is catching up to what operating systems have allowed users to do for decades.

Here are some examples of user personalization on the web:

  1. Being able to select your preferred color mode. And, even better, the website automatically saves and respects your preference when the page is loaded. Or better yet, looking at your operating system preferences and automatically accommodating them.
  2. Setting the default size of elements. Especially font size. A small font might look good in a design, but allowing users to set their ideal font size makes the content actually readable. Technically, every modern browser has an option to zoom into content, but that is often unwieldy, and does not actually save your settings.
  3. Setting the compactness of elements. For example, some people prefer large padding with rounded corners, while others find it a waste of space, instead preferring a tighter UI. Sort of like how Gmail lets you decide whether you want a lot of breathing room in your inbox or make it as small and tight as possible to see more content.
  4. Setting the primary color on the website. While this is entirely cosmetic, it is still charming to be able to set your favorite color on every button and link on a website.
  5. Enabling a high contrast mode. Someone pointed this out to me on GitHub. Apparently, many (and I mean many) CSS frameworks often fail the minimum contrast recommended between foreground and background colors on common elements, such as buttons. That list includes Halfmoon. This is often a tradeoff, because overly contrastive elements often look worse (purely in terms of aesthetic). User personalization can allow you to turn on a high contrast mode, if you have difficulty with the default contrast.

Allowing for user personalizations can be really difficult to pull off — especially for a framework — because that would could mean swapping out huge parts of CSS to accommodate the different personalization settings and combinations. However, with a framework like Halfmoon (i.e. built entirely using CSS variables), this becomes trivial as CSS variables can be set and changed on run-time using JavaScript, like so:

// Get the <html> tag (for reading and setting variables in global scope)
var myElement = document.documentElement;

// Read CSS variable
getComputedStyle(myElement).getPropertyValue("--variable-name");

// Set CSS variable
myElement.style.setProperty("--variable-name", "value");

Therefore, user personalization can be implemented using Halfmoon in the following way:

  • The user sets a preference. That basically means a variable value gets changed. The variable is set with JavaScript (as shown above), and the new value is stored in a cookie or local storage.
  • When the user comes back to the website, their preferences are retrieved and set using JavaScript (again, as shown above) once the page is loaded.

Here are visual examples to really hammer the point home.

Setting and saving the default font size

In the example above, whenever the range slider is changed, the variable --base-font-size is updated to the slider’s value. This is great for people who prefer larger text. As explained in the previous section, this new value can be saved in a cookie or local storage, and the next time the user visits the website, the user preference can be set on page load.

Setting the compactness of content

Compact theme using CSS variables
Because there are CSS custom properties used as utilities, like spacing and borders, we can remove or override them easily to create a more compact or expanded component layout.

Only two variables are updated in this example to go from an expanded view to a compact one:

  • --content-and-card-spacing changed from 3rem (30px) to 2rem (20px).
  • --card-border-radius changed from 0.4rem (4px) to 0.2rem (2px).

For a real life scenario, you could have a dropdown that asks the user whether they prefer their content to be Default or Compact, and choosing one would obviously set the above CSS variables to theme the site. Once again, this could be saved and set on page load when the user visits the website on their next session.

Wait, but why?

Even with all the examples I have shown so far, you may still be asking why is this actually necessary. The answer is really simple: one size does not fit all. In my estimate, around half of the population prefers a dark UI, while the other half prefers light. Similarly, people have wild variations about the things they like when it comes to design. User personalization is a form of improving the UX, because it lets the user choose what they prefer. This may not be so important on a landing page, but when it comes to a tool or dashboard (that one has to use for a long time to get something done), having a UI that can be personalized is a boon to productivity. And knowing that is what Halfmoon is designed to do makes it ideal for these types of use cases.

Moreover, you know how people often complain that websites made with a certain framework (eg Bootstrap) all look the same? This is a step toward making sure that websites built with Halfmoon will always look distinct, so that the focus is on the website and content itself, and not on the framework that was used to build it.

Again, I am not saying that everything should be allowed to be personalized. But knowing who the framework is for and what it is designed to do helps make it clear what should be personalized.

Looking ahead

I strongly feel that flexibility for customization and accounting for user preferences are often overlooked on the web, especially in the framework landscape. That’s what I’m trying to address with Halfmoon.

In the future, I want to make it a lot easier for developers to implement user preferences, and also promote diversity of design with new templates and themes. That said, here are some things on the horizon for Halfmoon:

  • A form validator (demo video)
  • New components, including range sliders, tabs and spinners
  • High contrast mode user preference
  • Multi-select component (like Select2, only without jQuery)
  • A date and time picker
  • A data-table component
  • A GUI-based form builder
  • More themes and templates

You can, of course, learn more about Halfmoon in the documentation website, and if you want to follow the project, you can give it a star on GitHub.


The post Considerations for Making a CSS Framework appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.



from CSS-Tricks https://ift.tt/3nWzbwc
via IFTTT

Amazon expands IP Accelerator to Europe after US SMBs register 6,000 trademarks

As we head into the biggest shopping period of the year — which this year may well have an even stronger online component than usual because of Covid-19 — Amazon has launched its latest effort to combat the sale of counterfeit goods on its site.

The e-commerce giant today announced that its free IP Accelerator in now live in Europe — specifically France, Germany, Italy, Spain, Netherlands and the United Kingdom — to help SMBs selling on Amazon obtain trademarks on their intellectual property, protect their brands and tackle the sale of counterfeit goods, connecting companies with recommended legal firms to carry out work. Joining the IP Accelerator is free, while the legal aid is provided as “low-cost assistance”, with those costs coming in the form of “competitive, pre-negotiated rates,” Amazon said.

The European launch — in Amazon’s six biggest markets in Europe, covering more than 150,000 small and medium businesses selling on Amazon’s platform, which account for more than half the products sold in the region — comes just over a year after Amazon kicked off an IP Accelerator in the U.S., in October 2019.

Amazon today said that the U.S. effort has so far yielded 6,000 trademark applications submitted to the US Patent and Trademark Office by SMBs working through the program.

Amazon has long struggled with counterfeit and other illicit items sold through its marketplace — which brings in third-party sellers and is built on the very concept of economies of scale, offering a vast array of choices to shoppers, and the IP Accelerator comes on the heels of a lot of other proactive efforts to battle the situation.

They have included Amazon filing a number of lawsuits — both on its own and in partnership with others, and most recently, just this month, being the plaintiff in a case that interestingly extended outside its own platform to target online influencers.

It also has built a lot of technology also to help track and spot illicit goods.

And it’s working with government authorities, most recently in an initiative to halt the import of counterfeit inventory before it gets sold or delivered to buyers.

It’s a Sisyphean task in some regards: Amazon’s growth means more sellers, and more goods to triage, and more chances for dodgy items. But it’s one that is very much in Amazon’s interest to get right: if it can’t protect IP, the best brands will stay away, and consumers will start to lose confidence in the platform, too.

That’s where initiatives like the IP Accelerator come in, where the idea is that it gives sellers who are smaller more direct control over their own brand destinies. The focus on SMBs is very specific and not just because of their collective selling power on Amazon. They are most often not in full possession of their legal options, and perhaps also worried about the costs of getting involved in trademarking, with a recent report from the European Intellectual Property Office finding that just 9% of SMBs have registered IP rights, versus 36% of larger companies.

“We know from our conversations with small business owners that there is often confusion about why IP rights are important and how sellers can secure them,” said Francois Saugier, Vice President for EU Seller Services, Amazon, in a statement. “As part of our broader commitment to supporting small businesses, we have set up IP Accelerator to make the IP registration process as easy and as affordable as possible for entrepreneurs in the early days of their businesses.”

In addition to legal assistance, SMBs in the program can join the Amazon’s Brand Registry, which currently covers some 350,000 brands and gives them ways to manage and track their brands, using automated algorithms built by Amazon to proactively track for potential copycats and other trademark criminals.

The business of providing services to SMBs on the platform is an interesting one.

We’ve seen a number of startups emerge in recent times that are looking to acquire and roll up the best of the SMBs that sell on Amazon with big ambitions of their own.

Their plans are to use economies of scale to run these businesses better, with better supply-chain management, marketing, IP control and more. That strategy is predicated on the fact that those small businesses are finding it a challenge to take their enterprises to the next level on their own.

In that regard, Amazon’s IP Accelerator potentially gives those smaller sellers another helping hand to stay independent (or at least grow their businesses enough to catch the attention of these consolidators).

“Great ideas are the core of every good business. Turning those ideas into a reality relies on IP,” said Pippa Hall, director of Innovation and Chief Economist at the UK’s Intellectual Property Office, said in a statement. “Understanding, protecting and getting the most out of your IP is a crucial ingredient of success. A good IP strategy should sit at the heart of every good business plan.”



from Amazon – TechCrunch https://ift.tt/2V7kaeh
via IFTTT

Tuesday, November 24, 2020

Mostly Clear today!



With a high of F and a low of 20F. Currently, it's 27F and Clear outside.

Current wind speeds: 11 from the Northwest

Pollen: 0

Sunrise: November 24, 2020 at 07:45PM

Sunset: November 25, 2020 at 05:31AM

UV index: 0

Humidity: 72%

via https://ift.tt/2livfew

November 25, 2020 at 10:00AM

Rendering Spectrum

Here are the big categories of rendering websites:

  • Client: ship a <div id="root"></div> and let a JavaScript template render all of it.
  • Static: pre-render all the HTML.
  • Server: let a live server process requests and generate the HTML response.

They are not mutually exclusive.

  • A website could statically pre-render 75% of it’s pages (say, blog posts), but the other 25% have a server respond to (say, forums).
  • A website could statically pre-render all the pages, but have a couple of empty <div>s in there that have client-side rendered content in them (e.g. a dynamically generated menu based on the logged-in user).
  • A website could be primarily server-rendered, but has caching in front of it such that it behaves statically.
  • A website could render statically, but then “hydrate” itself into an entirely client-rendered site.
  • A website could be a mix of server and static rendering, but have dynamic parts similar to client-side rendering, but actually happen in an edge function, so it ends up more like server-side rendering.

Next.js is interesting in that it can do all three. Here’s Tim Neutkens in a recent interview:

Next.js allows you to pre-render pages. It creates HTML on a server at build time with static site generation or uses run-time rendering on the server side. Next allows you to do a hybrid of those. Unlike most other frameworks, you are not bound by, oh, I’m going to build my app completely statically generated. Instead, you’re allowed to have some pages be server-side rendered and some pages be statically generated.

In the new release we make it possible to update these statically generated pages without having to run a new build, rebuilding your whole app.

Cool. Love to see that happening at the framework level. Seems like having to go all-in on one rendering style isn’t practical for a lot of sites.

Client rendering is the most flexible, but comes with all these serious downsides like worse performance, worse reliability, more strain on devices, bad SEO, etc. Static pre-rendering is the most robust, speedy, and secure, but is the most limited. Edge functions on top of static is starting to open doors, but server-rendering is the classic mix of flexibility and speed that has dominated the web for good reason.

Client rendering also opens the door for that “SPA” (Single Page App) feel. I still like that, personally. I like the no-page-refresh feel. It’s makes a site feel snappy and opens the door for page transitions. Gatsby is famous for popularizing hydration, where you get the pre-rendered static bonus, but then the upgrade into SPA as the JavaScript downloads.

I’d love to see the web get to the point where we get all that “good feel” bonus of an SPA without actually having to build an SPA. It’s notable when frameworks provide SPA feels without having to manage much of that yourself, but still, something is managing it and that something is a bunch of JavaScript.

Tom MacWright wrote about that recently in his “If not SPAs, What?” post. Some of today’s alternatives:

Turbolinks … what is the bare minimum you need to do to get the SPA experience without any cooperation from your application?

Turbolinks is like… click link, click is intercepted, Ajax request for new page is made, JavaScript flops out the content on the page with the new content. Super easy to implement, but it’s still JavaScript, and not particularly intelligent about sending less data across the wire.

barba.js and instant.page are alternative approaches to the same sort of problem.

Barba is all about getting page transitions going (more detail on that concept). instant.page is all about pre-loading/rendering pages right before you click then, so even though you get a page refresh, it feels less intrusive (particularly with paint holding). Both are cool, but not quite one-to-one replacements for an SPA. (Even with paint holding, pre-rendering, and lightweight pages, I still don’t think the experience is quite a smooth as an SPA. For example, you still get the page loading spinner.)

So… is the anything else cooking? Kinda. There is <portal>. Possibly too simplified, but here goes: portals are like iframes. They can even be visually displayed just like an iframe. That means the rendering of the URL in the portal is already done. Then you can “promote” the portal to be the active page, and even animate the portal itself while doing so.

I don’t hate it. I can imagine someone building a turbolinks-like library on portals so they are “easy to use” and make a site more SPA-like.

Still, animating a rectangle into position isn’t often what is desired from animated page transitions. Just look at Sarah’s “Native-Like Animations for Page Transitions on the Web” article. That’s what the people want (at least the possibility of it). That’s why Jeremy said not portals the other day when he cheekily said that “[m]ost single page apps are just giant carousels.” He also points to Jake’s navigation-transitions proposal from a few years back.

I love this proposal. It focuses on user needs. It also asks why people reach for JavaScript frameworks instead of using what browsers provide. People reach for JavaScript frameworks because browsers don’t yet provide some functionality: components like tabs or accordions; DOM diffing; control over styling complex form elements; navigation transitions. The problems that JavaScript frameworks are solving today should be seen as the R&D departments for web standards of tomorrow. (And conversely, I strongly believe that the aim of any good JavaScript framework should be to make itself redundant.)

So what’s the best rendering method? Whatever works best for you, but perhaps a hierarchy like this makes some general sense:

  1. Static HTML as much as you can
  2. Edge functions over static HTML so you can do whatever dynamic things
  3. Server generated HTML what you have to after that
  4. Client-side render only what you absolutely have to

The post Rendering Spectrum appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.



from CSS-Tricks https://ift.tt/2J6PQhh
via IFTTT

Mostly Clear today!

With a high of F and a low of 15F. Currently, it's 14F and Clear outside. Current wind speeds: 13 from the Southwest Pollen: 0 S...