Replies: 8 comments 4 replies
-
Here some ideas for tooltips: * {
--size-arrow:10px;
--tooltip-arrow-bottom:polygon(0 0,100% 0,100% calc(100% - var(--size-arrow)),calc(50% + var(--size-arrow)) calc(100% - var(--size-arrow)),50% 100%,calc(50% - var(--size-arrow)) calc(100% - var(--size-arrow)),0 calc(100% - var(--size-arrow)));
--tooltip-arrow-top:polygon(0 var(--size-arrow),calc(50% - var(--size-arrow)) var(--size-arrow),50% 0,calc(50% + var(--size-arrow)) var(--size-arrow),100% var(--size-arrow),100% 100%,0 100%);
--tooltip-arrow-left:polygon(var(--size-arrow) 0,100% 0,100% 100%,var(--size-arrow) 100%,var(--size-arrow) calc(50% + var(--size-arrow)),0 50%,var(--size-arrow) calc(50% - var(--size-arrow)));
--tooltip-arrow-right:polygon(0 0,calc(100% - var(--size-arrow)) 0,calc(100% - var(--size-arrow)) calc(50% - var(--size-arrow)),100% 50%,calc(100% - var(--size-arrow)) calc(50% + var(--size-arrow)), calc(100% - var(--size-arrow)) 100%,0 100%);
} 4 Types of clipping based on the arrow position + one variable to control the arrow size (feel free to update the naming as I am not good at it) |
Beta Was this translation helpful? Give feedback.
-
An idea for a breadcrumb system: * {
--breadcrumb-size:10px;
--breadcrumb-start:polygon(0 0,calc(100% - var(--breadcrumb-size)) 0,100% 50%,calc(100% - var(--breadcrumb-size)) 100%,0 100%);
--breadcrumb-step:polygon(0 0,calc(100% - var(--breadcrumb-size)) 0,100% 50%,calc(100% - var(--breadcrumb-size)) 100%,0 100%,var(--breadcrumb-size) 50%);
--breadcrumb-end:polygon(0 0,100% 0,100% 100%,0 100%,var(--breadcrumb-size) 50%);
} We have the shape for the first,middle and last element + a variable to control the size of the arrow |
Beta Was this translation helpful? Give feedback.
-
Some slanted shapes * {
--slant-size:10px;
--slant-top-1:polygon(0 var(--slant-size),100% 0,100% 100%,0 100%);
--slant-top-2:polygon(0 0,100% var(--slant-size),100% 100%,0 100%);
--slant-left-1:polygon(var(--slant-size) 0,100% 0,100% 100%,0 100%);
--slant-left-2:polygon(0 0,100% 0,100% 100%,var(--slant-size) 100%);
--slant-right-1:polygon(0 0,100% 0,calc(100% - var(--slant-size)) 100%,0 100%);
--slant-right-2:polygon(0 0,calc(100% - var(--slant-size)) 0,100% 100%,0 100%);
--slant-bottom-1:polygon(0 0,100% 0,100% calc(100% - var(--slant-size)),0 100%);
--slant-bottom-2:polygon(0 0,100% 0,100% 100%,0 calc(100% - var(--slant-size)));
--slant-horizontal-1:polygon(var(--slant-size) 0,100% 0,calc(100% - var(--slant-size)) 100% ,0 100%);
--slant-horizontal-2:polygon(0 0,calc(100% - var(--slant-size)) 0,100% 100%,var(--slant-size) 100%);
--slant-vertical-1:polygon(0 var(--slant-size),100% 0,100% calc(100% - var(--slant-size)),0 100%);
--slant-vertical-2:polygon(0 0,100% var(--slant-size),100% 100%,0 calc(100% - var(--slant-size)));
} I made a variable for each case + a variable to control the "slant". Here also we need better naming I guess. |
Beta Was this translation helpful? Give feedback.
-
Adding my new generator for section divider: https://css-generators.com/section-divider/ (related article: https://www.freecodecamp.org/news/section-divider-using-css/) I think they fit perfectly here since I generate one value per clip-path |
Beta Was this translation helpful? Give feedback.
-
Adding another Generator here for some clip-path values to create a Starburst shape: https://css-generators.com/starburst-shape/ |
Beta Was this translation helpful? Give feedback.
-
Adding another Generator for polygon shapes: https://css-generators.com/polygon-shape/ The outline versions could be interesting, their code is lengthy and not easy to handle so it's good for a Custom Property |
Beta Was this translation helpful? Give feedback.
-
more shapes |
Beta Was this translation helpful? Give feedback.
-
https://css-shape.com has a bunch of snippets that would do well as props too |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
handy named clip-paths, good start here
https://github.com/argyleink/transition.css/blob/main/src/circles/_vars.css
https://css-tricks.com/create-a-responsive-css-motion-path-sure-we-can/
https://simplecss.eu/clip-path.html#
https://tympanus.net/codrops-playground/SaraSoueidan/Pv7zhGno/editorhttps://bennettfeely.com/clippy/
Beta Was this translation helpful? Give feedback.
All reactions