Skip to content

Instantly share code, notes, and snippets.

@askdesign
Last active April 21, 2022 18:46
Show Gist options
  • Save askdesign/4799e6e029722f359e696372e62ab3ca to your computer and use it in GitHub Desktop.
Save askdesign/4799e6e029722f359e696372e62ab3ca to your computer and use it in GitHub Desktop.
/* --- Arrow in middle: top size is 150px, with 10px gap betwween top and bottom --- */
.top {
clip-path: polygon(0 0,100% 0,100% calc(100% - 150px),calc(50% + 150.00px) calc(100% - 150px),50% 100%,calc(50% - 150.00px) calc(100% - 150px),0 calc(100% - 150px));
}
.bottom {
clip-path: polygon(0 0,calc(50% - 4.14px - 150.00px) 0,50% calc(150px + 4.14px),calc(50% + 4.14px + 150.00px) 0,100% 0,100% 100%,0 100%);
margin-top: -140px;
}
/* --- Full-width Arrow: top size is 150px, with 10px gap betwween top and bottom --- */
.top {
clip-path: polygon(0 0,100% 0,100% calc(100% - 150px),50% 100%,0 calc(100% - 150px));
}
.bottom {
clip-path: polygon(0 0,50% 150px,100% 0,100% 100%,0 100%);
margin-top: -140px;
}
/* --- Slanted: top size is 150px, with 10px gap betwween top and bottom --- */
.top {
clip-path: polygon(0 0,100% 0,100% 100%,0 calc(100% - 150px));
}
.bottom {
clip-path: polygon(0 0,100% 150px,100% 100%,0 100%);
margin-top: -140px;
}
/* --- Straight across, with 10px gap betwween top and bottom --- */
.top {
clip-path: polygon(0 0,100% 0,100% calc(100% - 0px),0 100%);
}
.bottom {
clip-path: polygon(0 0px,100% 0,100% 100%,0 100%);
margin-top: 10px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment