<div class="panel">
<div class="frame rim"></div>
<div class="frame accent"></div>
<div class="frame accent glow"></div>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Magni harum vitae, ex ad aut corrupti corporis molestias velit exercitationem numquam cupiditate fuga, esse maxime officiis beatae molestiae odio in dolore!
</div>
.panel {
position: relative;
width: 300px;
padding: 1em;
background-color: #111216;
}
.panel .frame,
.panel .frame::before {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
box-sizing: border-box;
}
/* Gray border */
.frame.rim {
border: 1px solid #303030;
box-shadow:
inset 0 0 0 1px #0a0a0a,
0 0 0 1px #0a0a0a;
}
/* Green accent edges */
.frame.accent::before {
content: '';
background-image: linear-gradient(
to top,
#8bc34a,
#33691e66 25%,
transparent 70%
);
clip-path: polygon(
/* Trace around the box clockwise */
0 0,
100% 0,
100% 100%,
0 100%,
0 0,
/* Move 1px inward and run back around counter-clockwise */
1px 1px,
1px calc(100% - 1px),
calc(100% - 1px) calc(100% - 1px),
calc(100% - 1px) 1px,
1px 1px
);
}
/* Glow is just a copy of the accent frame with a blur filter */
.frame.accent.glow {
filter: blur(4px);
}
body {
background-color: #0b0c0d;
color: silver;
font-family: Segoe UI,Helvetica Neue,Tahoma,Geneva,Verdana,sans-serif;
display: flex;
align-items: center;
justify-content: center;
width: 100vw;
height: 100vh;
overflow: hidden;
margin: 0;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.