Simplemente logré lo contrario de esto usando :aftery ::afterporque necesitaba hacer mi borde inferior exactamente 1.3remmás ancho:
Mi elemento consiguió deforma súper cuando utilicé :beforey :afteral mismo tiempo porque los elementos están alineadas horizontalmente con display: flex, flex-direction: rowy align-items: center.
Puede usar esto para hacer algo más ancho o más estrecho, o probablemente cualquier modificación de dimensión matemática:
a.nav_link-active {
color: $e1-red;
margin-top: 3.7rem;
}
a.nav_link-active:visited {
color: $e1-red;
}
a.nav_link-active:after {
content: '';
margin-top: 3.3rem; // margin and height should
height: 0.4rem; // add up to active link margin
background: $e1-red;
margin-left: -$nav-spacer-margin;
display: block;
}
a.nav_link-active::after {
content: '';
margin-top: 3.3rem; // margin and height should
height: 0.4rem; // add up to active link margin
background: $e1-red;
margin-right: -$nav-spacer-margin;
display: block;
}
Lo siento, esto es SCSS, simplemente multiplica los números por 10 y cambia las variables con algunos valores normales.
div:beforeleft: 50px.