流星:使用多个样式表 [英] meteor: using more than one stylesheet

查看:44
本文介绍了流星:使用多个样式表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有 twitter bootstrap css 文件和应用程序样式文件的流星项目.我怎样才能让 styl 优先于 bootstrap css?即两个文件中可能存在冲突的标签,但我不希望不必通过引导 css 来删除它们.

I have a meteor project with a twitter bootstrap css file and an app styl file. how can i have the styl take precedence over the bootstrap css? i.e. there may be conflicting tags in both files but i'd like not to have to comb through the bootstrap css to remove them.

在添加 bootstrap css 之前,我的格式看起来就像我喜欢的那样.添加 bootstrap css 后,一些格式被关闭.

before adding bootstrap css, my formatting looked just the way i liked it to be. after adding the bootstrap css, some of the formatting was off.

推荐答案

我不推荐使用 !important 规则,因为它会弄乱你的代码并使其难以维护.

I can not recommend using !important rule since it will mess up your code and make it hard to maintain.

在 Meteor 中,您可以使用任意数量的样式表,只需记住加载顺序:

In Meteor you can use as much stylesheets as you like you just have to keep the load order in mind:

  • 首先加载应用程序根目录中 lib 目录中的文件.
  • 与 main.* 匹配的文件在其他所有文件之后加载.
  • 子目录中的文件先于父目录中的文件加载,以便加载最深子目录中的文件首先(在lib之后),最后加载根目录中的文件(除了 main.*).
  • 在目录中,文件按文件名的字母顺序加载.

这些规则堆叠,所以在lib中,例如,文件仍然是按字母顺序加载;如果有多个文件命名main.js,子目录下的加载较早.

These rules stack, so that within lib, for example, files are still loaded in alphabetical order; and if there are multiple files named main.js, the ones in subdirectories are loaded earlier.

有关详细信息,请查看 docs.meteor.com.

For more info take a look at docs.meteor.com.

这篇关于流星:使用多个样式表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆