grant.codes

Jump to menu
  • About
  • Contact
  • Projects
  • Updates
  • More...Likes
  • Photos
  • Galleries
  • Replies
👈🕸💍👉

Liked https://css-tricks.com/maskable-icons-android-adaptive-icons-for-your-pwa/

Maskable Icons: Android Adaptive Icons for Your PWA

Youve created a Progressive Web App (PWA), designed an icon to represent it, and now youre installing it to your Android home screen.

Folder containing icons with transparent backgrounds or solid backgrounds

But, if you have a recent Android phone, your icons will show up like this:

Homescreen with icons inside white circles

What happened? Well, Android Oreo introduced adaptive icons, a new icon format that enforces the same shape for all icons on the home screen. Icons that dont follow the new format are given a white background.

However, there is a new web feature called maskable icons that is coming soon to Firefox Preview and other web browsers. This new icon format will let your PWAs have their own adaptive icons on Android.

I work at Mozilla and have implemented support for maskable icons in Firefox Preview. Ill show you how to add them to your own PWAs for Android.

What are maskable and adaptive icons?

Until a few years ago, Android app icons were freeform and could be any shape. This meant that web apps could also reuse the same transparent icon when pinned to the home screen.

Icons of various shapes and sizes

However, manufacturers, like Samsung, wanted to make all icons on a device the same shape to keep things consistent. Some manufacturers even wanted different shapes. To deal with the variety of requirements from manufacturers and devices, Android introduced adaptive icons. You supply an image with extra space around the edges, and Android will crop it to the correct shape.

Icons restricted to different shapes

But web apps are designed to work on any platform, so they dont have APIs to create these special Android icons. Instead, icons would get squished into white boxes like this:

Icons stuck in shapes with white backgrounds

Lo and behold, last September a brand new API descended upon us and was added to the W3C spec. Maskable icons allow web developers to specify a full-bleed icon that will be cropped. Its platform agnostic, so Windows could use them for tiles or iOS could use them for icons.

Icons with detailed backgrounds restricted to different shapes

How to create maskable icons

Since the maskable icon format is designed work with any platform, the size and ratios are different from the size and ratios of Androids adaptive icons. This means you cant reuse the same asset.

Maskable icons can be any size, and you can continue to use the same sizes that youd use for normal transparent icons. But when designing the icon, ensure that important information is within a safe zone circle with a radius equal to 40% of the images size.

The safe zone

All pixels within this zone are guaranteed to be visible. Pixels outside the zone may be cropped off depending on the icon shape and the platform.

Warning: If you already have an Android app, avoid copying and pasting the icon from your Android app to your web app. The ratios are different, so your icons would look too small.

Adding the icon to your Web App Manifest

Once the icons are created, you can add an entry to your Web App Manifest similar to other icon assets. The Web App Manifest provides information about your web app in a JSON file, and includes an "icons" array.

{
  ...
  "icons": [
    ...
    {
      "src": "path/to/maskable_icon.png",
      "sizes": "196x196",
      "type": "image/png",
      "purpose": "maskable"
  ]
  ...
}

Maskable icons use a special new key, "purpose", to indicate that they are meant to be used with icon masks. Icons with transparent backgrounds have a default "purpose" of "any", and icons can be used for multiple purposes by separating each option with a space.

"purpose": "maskable any"

Preview your icons

Do you want to see what your own maskable icons will look like? Ive created a tool, Maskable.app, to help you evaluate how the icon appears in different shapes.

The app lets you preview your icon in various shapes that can be found on Android devices. I hope this tool helps you create unique icons for your Progressive Web Apps.

Once youre satisfied with the results, you can start testing your app with Mozillas Reference Browser. This special browser is a testing ground for features before they reach Firefox Preview, and you can use it to check out how your PWA looks.

Tools like PWACompat also have support for maskable icons. You can automatically generate icons for iOS and other devices based on your new maskable icons!

Time to build your own icons

If you want to more control over how your PWA icons are displayed on Android, maskable icons is the way to go. With maskable icons you can customize how your icon is displayed from edge-to-edge. Hopefully this article can get you started on creating your first maskable icon.

Icon Credits:

Posted 6 years ago
Liked 6 years ago

Liked https://www.customerservant.com/read-a-new-era-for-the-genesis-framework-recapping-the-biggest-changes-and-how-to-work-with-them-by-cdils-and-added-some-indieweb-thoughts-approaching-heresy-spoiler-alert-were-gonna-have/

Amanda RushPublished28 August 2019 by Amanda Rush | 28 August 2019 Read A New Era for the Genesis Framework: Recapping the Biggest Changes and How to Work with Them by Carrie Dils (Carrie Dils)It’s been roughly one year since WP Engine acquired StudioPress, the makers of the Genesis Framework. There’s been a lot of forward progress, but it may have left some people feeling unsure about how to work with Genesis or best take advantage of new features.I’ve always loved the Genesis framework, and I still use it on client sites. While reading this post by Carrie, I began to think that those of us in the Indieweb community may quickly need to embrace blocks.Yes, I know, that’s basically heresy, but I’m thinking this may need to happen sooner rather than later since Gutenberg development is pretty rapid, the accessibility issues are being fixed pretty quickly, and the end of 2021 will get here before we know it. Post kinds as blocks, for example, would probably be a lot easier to share across themes, as opposed to now, when themes either have to be forked and customized or created from scratch to explicitly support microformats 2.Granted, you can have indieweb without post kinds, but post kinds is what enables people to truly own all of their content. And right now, there are only a few people doing the heavy lifting with regard to themes. That’s an untennable situation for a ton of reasons.In order for this to change, it’s going to have to become easier for other designers and developers, (let alone users), to implement this stuff, and there are two ways that can happen. The first is WordPress as a project adopts all the indieweb building blocks. This would be the best solution, but I don’t see it happening anytime soon. The second way is us adopting blocks on the model of something like the Automic Blocks plugin or similar, at least for the post kinds/microformats 2 part.I suppose there’s a third way, where WordPress adopts things like webmention and the other open standards, and blocks for post kinds is the compromise.These are all just thoughts, but the Genesis framework has somewhere around 250,000 users, it’s backed by its owning hosting company, and it really does provide an easy way for users to build sites, with some accessibility included. And I think expecting users to do the heavy lifting for themes just isn’t sellable.There’s a lot of promise contained in Gutenberg and the whole blocks concept, including the up-ending of what is the current raging dumpster fire which is the WordPress theme ecosystem, (with some notable exceptions for some themes). I’m thinking we should go with the flow as best we can.Share this:FacebookLinkedInTwitterLike this:Like Loading... Comment. Respond on your own site: Respond Leave a Reply Cancel replyComment.CommentYour email address will not be published. Required fields are marked *Name * Email * Website Notify me of follow-up comments by email. Notify me of new posts by email. This site uses Akismet to reduce spam. Learn how your comment data is processed. To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Learn More) githubGitHub icontwitterTwitter iconfacebookFacebook iconarush.iogithubGitHub icontwitterTwitter iconfacebookFacebook iconarush.io Indieweb Publisher empowered by WordPress %d bloggers like this:

I’ve always loved the Genesis framework, and I still use it on client sites. While reading this post by Carrie, I began to think that those of us in the Indieweb community may quickly need to embrace blocks.

Yes, I know, that’s basically heresy, but I’m thinking this may need to happen sooner rather than later since Gutenberg development is pretty rapid, the accessibility issues are being fixed pretty quickly, and the end of 2021 will get here before we know it. Post kinds as blocks, for example, would probably be a lot easier to share across themes, as opposed to now, when themes either have to be forked and customized or created from scratch to explicitly support microformats 2.

Granted, you can have indieweb without post kinds, but post kinds is what enables people to truly own all of their content. And right now, there are only a few people doing the heavy lifting with regard to themes. That’s an untennable situation for a ton of reasons.

In order for this to change, it’s going to have to become easier for other designers and developers, (let alone users), to implement this stuff, and there are two ways that can happen. The first is WordPress as a project adopts all the indieweb building blocks. This would be the best solution, but I don’t see it happening anytime soon. The second way is us adopting blocks on the model of something like the Automic Blocks plugin or similar, at least for the post kinds/microformats 2 part.

I suppose there’s a third way, where WordPress adopts things like webmention and the other open standards, and blocks for post kinds is the compromise.

These are all just thoughts, but the Genesis framework has somewhere around 250,000 users, it’s backed by its owning hosting company, and it really does provide an easy way for users to build sites, with some accessibility included. And I think expecting users to do the heavy lifting for themes just isn’t sellable.

There’s a lot of promise contained in Gutenberg and the whole blocks concept, including the up-ending of what is the current raging dumpster fire which is the WordPress theme ecosystem, (with some notable exceptions for some themes). I’m thinking we should go with the flow as best we can.

Posted 6 years ago by
Amanda Rush
Liked 6 years ago

Liked https://www.yankodesign.com/2019/08/23/this-desk-has-an-assistant-desk-stacked-on-top-to-hold-more-stuff-for-you/

This desk has an assistant desk stacked on top, to hold more stuff for you

I love the cheeky design of the DUOO 2.0 Desk, as it efficiently adds a tier of holding space, for you to utilize well. Its like having a tray or box on top of your desk, to hold smaller items like your phone, pens, watch… the not very critical items, and then elevating it a little, so that you can keep additional gear under it.

Aesthetically, it looks very classy and complements the overall look of the desk. The mix of dark wood and black metal frame, just adds to the chic feel of the desk. Aside from the elevated tray, the design also includes a convenient cubby built into the table top, to hold your cables and wires, and keep the desk clutter-free.

Designer: Andrey Mohila for Zegen

Cling – Table & Chair Built In by O-D-A Studio

Posted 6 years ago by
R
Liked 6 years ago

Liked https://www.reddit.com/r/DeepIntoYouTube/comments/cvqetq/ground_control_to_magnum_dong/?utm_source=ifttt

Ground Control To Magnum Dong

Ground Control To Magnum Dong from DeepIntoYouTube
Posted 6 years ago by
AssHeadedDolt
Liked 6 years ago

Liked https://twitter.com/momodraws/status/1165996375508758529

Momo on Twitter

It is only natural pic.twitter.com/sNX37rXDL5

— Momo (@momodraws) August 26, 2019
Posted 6 years ago
Liked 6 years ago ● Also on:

Liked https://twitter.com/jenuflexion/status/1166027353958625281

KPMG dad on Twitter

Happy #InternationalDogDay ! You know i had to see what that butt looked like in 3d 😄 pic.twitter.com/kcas9mdhhA

— KPMG dad (@jenuflexion) August 26, 2019
Posted 6 years ago
Liked 6 years ago ● Also on:

Liked https://www.reddit.com/r/funny/comments/cvkakw/a_long_time_ago_in_a_galaxy_far_far_away_i/?utm_source=ifttt

A long time ago in a galaxy far, far away ... I purchased one measly item.

A long time ago in a galaxy far, far away ... I purchased one measly item. from funny
Posted 6 years ago by
dietolive6
Liked 6 years ago

Liked https://www.reddit.com/r/funny/comments/cvkakw/a_long_time_ago_in_a_galaxy_far_far_away_i/?utm_source=ifttt

A long time ago in a galaxy far, far away ... I purchased one measly item.

A long time ago in a galaxy far, far away ... I purchased one measly item. from funny
Posted 6 years ago by
dietolive6
Liked 6 years ago

Liked https://twitter.com/momodraws/status/1165932493775785986

Momo on Twitter

pic.twitter.com/2uSLxhRMk2

— Momo (@momodraws) August 26, 2019
Posted 6 years ago
Liked 6 years ago ● Also on:

Liked https://www.reddit.com/r/NatureIsFuckingLit/comments/cvh5db/momma_sea_otter_making_sure_her_pup_is_comfy/?utm_source=ifttt

🔥 Momma sea otter making sure her pup is comfy 🔥

🔥 Momma sea otter making sure her pup is comfy 🔥 from NatureIsFuckingLit
Posted 6 years ago by
to_the_tenth_power
Liked 6 years ago
NewerOlder
EmailInstagramGithub

Grant Richmond
grant.codes[email protected]