Twitter bootstrap 少包含路径
我将引导类隔离到一个顶级类中,以避免与我自己页面的CSS冲突,正如Chris Youderian在中所指出的那样。我使用以下Twitter bootstrap 少包含路径,twitter-bootstrap,less,Twitter Bootstrap,Less,我将引导类隔离到一个顶级类中,以避免与我自己页面的CSS冲突,正如Chris Youderian在中所指出的那样。我使用以下引导自定义.less文件: .bootstrap-custom { @import (less) '../libs/bootstrap/css/bootstrap.css'; } 问题是,当我使用glyphicons时,它会查找与我的bootstrap custom.less路径相关的字体,而不是bootstrap.css所在的路径 我不想将bootstrap cus
引导自定义.less
文件:
.bootstrap-custom {
@import (less) '../libs/bootstrap/css/bootstrap.css';
}
问题是,当我使用glyphicons时,它会查找与我的bootstrap custom.less
路径相关的字体,而不是bootstrap.css
所在的路径
我不想将bootstrap custom.less
放在bootstrap的文件夹中,因为它是由bower
管理的依赖项,看起来不正确
有没有一种方法可以在不修改引导代码的情况下解决这个问题?同样,我不想这样做,因为它是由包管理器管理的依赖项。我刚刚解决了我的问题 我只需在我的
bootstrap custom.less中重新声明font系列,如下所示:
.bootstrap-custom {
@import (less) '../libs/bootstrap/css/bootstrap.css';
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../libs/bootstrap/fonts/glyphicons-halflings-regular.eot');
src: url('../libs/bootstrap/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
url('../libs/bootstrap/fonts/glyphicons-halflings-regular.woff2') format('woff2'),
url('../libs/bootstrap/fonts/glyphicons-halflings-regular.woff') format('woff'),
url('../libs/bootstrap/fonts/glyphicons-halflings-regular.ttf') format('truetype'),
url('../libs/bootstrap/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}
}
我现在就用这个,但也许有人能想出更好的解决办法。。