@navelpluisje/pcb-components
Version:
A library with native components. They are all pcb components, like a dip-switch, resitor etc.
115 lines (101 loc) • 1.89 kB
CSS
.ic {
--background: hsl(0, 0%, 100%);
--knob-size: 4rem;
display: inline-block;
height: calc(var(--knob-size) * 1.1);
position: relative;
}
.ic-wrapper {
display: flex;
width: auto;
}
.ic-start,
.ic-end,
.ic-step {
align-items: center;
display: flex;
flex-direction: column;
height: 5rem;
position: relative;
width: 1rem;
}
.ic-body {
background-color: #434343;
border-width: .25rem 0;
border-style: solid;
border-color: #636363 transparent #232323;
flex: 1;
width: 100%;
}
.ic-start .ic-body {
border-width: .25rem 0 .25rem .15rem;
border-color: #636363 transparent #232323 #636363;
}
.ic-start .ic-body::before {
background: #333;
border-radius: 0 .6rem .6rem 0;
box-shadow:
-1px 1px 0 0 #232323 inset,
-1px -1px 0 0 #636363 inset;
content: '';
display: block;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
height: 1.2rem;
width: .6rem;
}
.ic-end .ic-body {
border-width: .25rem .15rem .25rem 0;
border-color: #636363 #232323 #232323 transparent;
}
.pin {
background: gold;
height: .65rem;
width: .25rem;
position: relative;
}
.pin::before {
background: inherit;
content: '';
display: block;
width: .5rem;
height: .4rem;
left: -.125rem;
position: absolute;
}
.pin-bottom::before {
top: -.1rem;
}
.pin-top::before {
bottom: -.1rem;
}
.label {
color: lightgray;
font-family: monospace;
font-size: .8rem;
left: 1rem;
position: absolute;
top: 1.2rem;
}
.value {
background-color: transparent;
border: none;
color: hsl(0, 0%, 90%);
font-weight: 600;
font-family: monospace;
font-size: 1rem;
left: 1rem;
padding: .25rem;
position: absolute;
top: 2.2rem;
transition: all .3s ease;
width: auto;
}
.value:focus {
background-color: white;
border: 1px solid gray;
border-radius: .25rem;
color: hsl(0, 0%, 30%);
}