Created
August 24, 2022 17:39
-
-
Save huksley/f14eabec9715da06f4f0b6f3972b188e to your computer and use it in GitHub Desktop.
Show element as selected as in Figma https://codesandbox.io/s/jolly-voice-0zi93u?file=/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>Locofy element select demo</title> | |
<style type="text/css"> | |
.design-element { | |
border: 1px dashed #8a6dc0; | |
color: #8a6dc0; | |
display: inline-block; | |
margin-left: -2px; | |
margin-right: -2px; | |
padding-left: 6px; | |
padding-right: 6px; | |
position: relative; | |
} | |
.design-element > span { | |
background-color: #fff; | |
border: 1px solid #8a6dc0; | |
border-radius: 50%; | |
display: block; | |
height: 6px; | |
position: absolute; | |
width: 6px; | |
} | |
.design-element > span:first-child { | |
left: 0; | |
top: 0; | |
transform: translate(-4px, -4px); | |
} | |
.design-element > span:nth-of-type(2) { | |
left: 50%; | |
top: 0; | |
transform: translate(-4px, -4px); | |
} | |
.design-element > span:nth-of-type(3) { | |
right: 0; | |
top: 0; | |
transform: translate(4px, -4px); | |
} | |
.design-element > span:nth-of-type(4) { | |
left: 0; | |
top: 50%; | |
transform: translate(-4px, -4px); | |
} | |
.design-element > span:nth-of-type(5) { | |
right: 0; | |
top: 50%; | |
transform: translate(4px, -4px); | |
} | |
.design-element > span:nth-of-type(6) { | |
bottom: 0; | |
left: 0; | |
transform: translate(-4px, 4px); | |
} | |
.design-element > span:nth-of-type(7) { | |
bottom: 0; | |
left: 50%; | |
transform: translate(-4px, 4px); | |
} | |
.design-element > span:nth-of-type(8) { | |
bottom: 0; | |
right: 0; | |
transform: translate(4px, 4px); | |
} | |
</style> | |
</head> | |
<body> | |
<h1> | |
Turn Figma | |
<span class="design-element" | |
>designs<span></span><span></span><span></span><span></span><span></span | |
><span></span><span></span><span></span | |
></span> | |
into a production ready code. | |
</h1> | |
As seen on <a href="https://www.locofy.ai/">locofy.ai</a> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment