gpt4 book ai didi

twitter-bootstrap - Bootstrap glyphicon 附加了 LESS,没有 html 触摸

转载 作者:行者123 更新时间:2023-12-04 23:21:01 25 4
gpt4 key购买 nike

我想知道是否有可能在不接触 HTML 的情况下附加 Bootstrap 字形图标并将其用作 LESS 混合,如下所示:

a {
.glyphicon;
.glyphicon-envelope;
}

任何帮助,将不胜感激。

最佳答案

是的你可以:


@import "variables.less";
@import (reference) "glyphicons.less";

a {
.glyphicon;
.glyphicon-envelope;
}

将编译成以下 CSS:
a {
position: relative;
top: 1px;
display: inline-block;
font-family: 'Glyphicons Halflings';
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
a:before {
content: "\2709";
}

请注意,如果您想在没有完整的 Bootstrap CSS 的情况下使用 CSS 或将字体定义添加到您的 Less 代码中,则不应将 reference 关键字与 @import 一起使用:
@font-face {
font-family: 'Glyphicons Halflings';
src: url('@{icon-font-path}@{icon-font-name}.eot');
src: url('@{icon-font-path}@{icon-font-name}.eot?#iefix') format('embedded-opentype'),
url('@{icon-font-path}@{icon-font-name}.woff') format('woff'),
url('@{icon-font-path}@{icon-font-name}.ttf') format('truetype'),
url('@{icon-font-path}@{icon-font-name}.svg#@{icon-font-svg-id}') format('svg');
}

还要考虑 extend feature少:


@import "variables.less";
@import (reference) "glyphicons.less";

a {
&:extend(.glyphicon);
&:extend(.glyphicon-envelope all);
}

关于twitter-bootstrap - Bootstrap glyphicon 附加了 LESS,没有 html 触摸,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26702988/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com