我已经尝试过复制一些接近的东西(一个版本用于文本按钮,一个用于图标版本):
图标版本假定 FontAwesome 用于生成图标(因此引用了 .fa):
/* text button */
.btn-glow {
border: 1px solid #354a40;
background-color: #1e2120;
padding: .5em .85em;
transition: all 0.025s linear;
color: #6c8678;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.75);
font-size: .75em;
font-weight: bold;
}
.btn-glow:hover {
color: #e6fcf5;
text-shadow: 1px 1px 1em #66977b;
border-image: linear-gradient(90deg, #375345, #9afdcf, #375345) 10;
background-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.1) 100%);
}
.btn-glow:focus {
color: #79c6a1;
border-image: linear-gradient(90deg, #375345, #9afdcf, #375345) 10;
background-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.1) 100%);
outline: none;
}
.btn-glow:active {
color: #fff;
text-shadow: 1px 1px 2em #9ee6bf;
background-color: #406552;
border-image: linear-gradient(90deg, #375345, #9afdcf, #375345) 10;
background-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.25) 100%);
}
/* icon version */
.btn-glow-large {
border: 1px solid #354a40;
background-color: #1e2120;
padding: 1em;
transition: all 0.025s linear;
}
.btn-glow-large .fa {
color: #6c8678;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.75);
transition: all 0.025s linear;
}
.btn-glow-large:hover {
border-image: linear-gradient(#375345, #9afdcf, #375345) 10;
background-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.1) 100%);
}
.btn-glow-large:hover .fa {
color: #e6fcf5;
text-shadow: 1px 1px 1em #66977b;
}
.btn-glow-large:focus {
border-image: linear-gradient(#375345, #9afdcf, #375345) 10;
background-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.1) 100%);
outline: none;
}
.btn-glow-large:focus .fa {
color: #79c6a1;
}
.btn-glow-large:active {
background-color: #406552;
border-image: linear-gradient(#375345, #9afdcf, #375345) 10;
background-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.25) 100%);
}
.btn-glow-large:active .fa {
color: #fff;
text-shadow: 1px 1px 2em #9ee6bf;
}
见https://codepen.io/ablewhite/pen/gWRQLN?editors=1100#0