gpt4 book ai didi

css - Meteor 如何为不同的媒体类型提供多个 css?

转载 作者:技术小花猫 更新时间:2023-10-29 12:03:33 26 4
gpt4 key购买 nike

我想让我的 Meteor 应用程序为各种媒体类型提供多个 css 页面。例如:

<link rel="stylesheet" type="text/css" media="screen" href="screen.css" />
<link rel="stylesheet" type="text/css" media="print" href="print.css" />
<link rel="stylesheet" type="text/css" media="handheld" href="handheld.css" />

我该怎么做?

最佳答案

/packages/meteor/package.js

定义了 .css 文件应该被捆绑。

然而,仔细观察 docs.meteor.com ,我们可以找到这个信息:

CSS files work just the same: the client will get a bundle with all the CSS in your tree (excluding the server and public subdirectories).

最后一部分很有趣,如果将 CSS 文件放在 /public 中,它们将不会捆绑在一起。相反,app/lib/bundler.js 在第 517 行附近执行以下操作:

files.cp_r(path.join(project_dir, 'public'),
path.join(build_path, 'static'), {ignore: ignore_files});

而服务器端,任何未解析的文件也会在build/static中检查,这意味着当您将screen.css放在/public中时 你可以在客户端继续使用 screen.css

关于css - Meteor 如何为不同的媒体类型提供多个 css?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10610279/

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