|
| 1 | +# Shaping Corners |
| 2 | + |
| 3 | +## The user need |
| 4 | +Squircles, and other shaped corners, have been [sought after](https://www.figma.com/blog/desperately-seeking-squircles/) in the web |
| 5 | +for quite a while. |
| 6 | + |
| 7 | +[Native platforms](https://blog.minimal.app/rounded-corners-in-the-apple-ecosystem/) have had different versions of them for a long time, |
| 8 | +and they have been a common design in the design ecosystem, everywhere except for in the web platform. |
| 9 | + |
| 10 | +## The solution |
| 11 | +To allow for these designs, CSS enhances the existing concept of `border-radius`, by allowing the author to specify how convex/concave |
| 12 | +the shape of the corner should be, alongside its radii. |
| 13 | + |
| 14 | +The `corner-shape` property accepts any value between `notch` (fully concave) and `square` (full convex), using the `superellipse()` function. |
| 15 | +Designers can choose the shape of the corner that they fancy, and also animate between different corner shapes. |
| 16 | + |
| 17 | +Borders and shadows are also shaped according to the given `corner-shape`. |
| 18 | + |
| 19 | +## Why "corners"? |
| 20 | +Alternatively to using the concept of corners, there was an option to use free-form shapes as borders. |
| 21 | +This is expressed in a separate proposal (`border-shape`). However, by extending the concept of corners the web platform allows |
| 22 | +this type of shaping to be a progressive enhancement on top of existing `border-radius`, as well as giving a relatively simple tool |
| 23 | +for shaping the corners rather than overloading everything on top of a general purpose shaping power tool. |
| 24 | + |
| 25 | +In addition, when constraining the problem to "corners", we can lift other constraints that exist on general-purpose shapes: for example, |
| 26 | +border styles are renderable because the edge-cases are more manageable. |
| 27 | + |
| 28 | + |
| 29 | +## Self review S&P questionnaire |
| 30 | + |
| 31 | +01. What information does this feature expose, |
| 32 | + and for what purposes? |
| 33 | + |
| 34 | +It does not expose information. |
| 35 | + |
| 36 | +3. Do features in your specification expose the minimum amount of information |
| 37 | + necessary to implement the intended functionality? |
| 38 | + |
| 39 | +Yes |
| 40 | + |
| 41 | +5. Do the features in your specification expose personal information, |
| 42 | + personally-identifiable information (PII), or information derived from |
| 43 | + either? |
| 44 | + |
| 45 | +No |
| 46 | + |
| 47 | +6. How do the features in your specification deal with sensitive information? |
| 48 | + |
| 49 | +No sensitive information |
| 50 | + |
| 51 | +8. Does data exposed by your specification carry related but distinct |
| 52 | + information that may not be obvious to users? |
| 53 | + |
| 54 | +No |
| 55 | + |
| 56 | +10. Do the features in your specification introduce state |
| 57 | + that persists across browsing sessions? |
| 58 | + |
| 59 | +No |
| 60 | + |
| 61 | +12. Do the features in your specification expose information about the |
| 62 | + underlying platform to origins? |
| 63 | + |
| 64 | +No |
| 65 | + |
| 66 | +14. Does this specification allow an origin to send data to the underlying |
| 67 | + platform? |
| 68 | + |
| 69 | +No |
| 70 | + |
| 71 | +16. Do features in this specification enable access to device sensors? |
| 72 | + |
| 73 | +No |
| 74 | + |
| 75 | +18. Do features in this specification enable new script execution/loading |
| 76 | + mechanisms? |
| 77 | + |
| 78 | +No |
| 79 | + |
| 80 | +20. Do features in this specification allow an origin to access other devices? |
| 81 | + |
| 82 | +No |
| 83 | + |
| 84 | +21. Do features in this specification allow an origin some measure of control over |
| 85 | + a user agent's native UI? |
| 86 | + |
| 87 | +No |
| 88 | + |
| 89 | +23. What temporary identifiers do the features in this specification create or |
| 90 | + expose to the web? |
| 91 | + |
| 92 | +None |
| 93 | + |
| 94 | +25. How does this specification distinguish between behavior in first-party and |
| 95 | + third-party contexts? |
| 96 | + |
| 97 | +No |
| 98 | + |
| 99 | +27. How do the features in this specification work in the context of a browser’s |
| 100 | + Private Browsing or Incognito mode? |
| 101 | + |
| 102 | +N/A |
| 103 | + |
| 104 | +29. Does this specification have both "Security Considerations" and "Privacy |
| 105 | + Considerations" sections? |
| 106 | + |
| 107 | +No |
| 108 | + |
| 109 | +31. Do features in your specification enable origins to downgrade default |
| 110 | + security protections? |
| 111 | + |
| 112 | +No |
| 113 | + |
| 114 | +33. What happens when a document that uses your feature is kept alive in BFCache |
| 115 | + (instead of getting destroyed) after navigation, and potentially gets reused |
| 116 | + on future navigations back to the document? |
| 117 | + |
| 118 | +Nothing in particular |
| 119 | + |
| 120 | +35. What happens when a document that uses your feature gets disconnected? |
| 121 | + |
| 122 | +N/A |
| 123 | + |
| 124 | +37. Does your spec define when and how new kinds of errors should be raised? |
| 125 | + |
| 126 | +No |
| 127 | + |
| 128 | +39. Does your feature allow sites to learn about the user's use of assistive technology? |
| 129 | + |
| 130 | +No |
| 131 | + |
| 132 | +40. What should this questionnaire have asked? |
| 133 | + |
| 134 | +Nothing in addition |
0 commit comments