Freddi67 on DeviantArthttp://creativecommons.org/licenses/by/3.0/https://www.deviantart.com/freddi67/art/How-to-apply-the-Ubuntu-style-to-web-apps-365921583Freddi67

Deviation Actions

How to apply the Ubuntu style to web apps

By
Published:
1.5K Views

Description

„Ubuntu shape”


The smooth mathematical curves, that the Ubuntu Touch interface inherited from Ubuntu's beautiful font, are not simple sections of a circle.
As such, they can not be authentically imitated using CSS border radius. Even Ubuntu's GTK3 theme as well as the QML theme solve the challenge by using pixmaps.
Luckily CSS doesn't stand behind, so why shouldn't we leverage its full potential?

.ubuntu-shape {
  border: 15px solid transparent;
  border-image: url('./ubuntu-shape.png') 40 stretch;
  /* A background color would cover the area behind the corners of
  the border, so we use a box-shadow for the fill */
  box-shadow: 0 0 0 1000px #dd4814 inset;
}


Download the attached HTML and image assets to see it in action or inspect it. Hover the orange boxes to compare Ubuntu's rounded corners with default CSS border-radius.
Comments2
Join the community to add your comment. Already a deviant? Log In
HEXcube's avatar
I still can't find an svg version of Ubuntu Touch shape Sad dummy. I needed it to do some Unity modding and theming.