我想在我的 Rails 4.2.6 应用程序模板中使用 pixelarity(如这个例子http://pixelarity.com/elemental)。
所以,我在 main.js (snippet) 中有有趣的构造
skel.init({
reset: 'full',
breakpoints: {
'global': { range: '*', href: 'style.css', containers: 1400, grid: { gutters: 48 } },
'wide': { range: '-1680', href: 'style-wide.css', containers: 1200 },
'normal': { range: '-1280', href: 'style-normal.css', containers: '100%', grid: { gutters: 36 } },
'narrow': { range: '-960', href: 'style-narrow.css', grid: { gutters: 32 } },
'narrower': { range: '-840', href: 'style-narrower.css', containers: '100%!', grid: { collapse: true } },
'mobile': { range: '-736', href: 'style-mobile.css', grid: { gutters: 20 }, viewport: { scalable: false } }
},
我的 layout.html.slim 包含
= stylesheet_link_tag "application", :media => "all"
= javascript_include_tag "application"
所以,当分辨率改变时,js会插入另一个css。完美的!
但我不明白如何将它附加到我的应用程序中。
如果我将文件放入application.scss
其中,它将为每个页面加载,这是错误的,并且文件名将被更改。
此时我使用public
dir,所有这些东西都在其中工作,但这是不对的,我感觉到它(而且我在那里没有缩小)。
我如何以 Rails 方式使用它?我怎样才能留下这个 css 文件的缩小,并用它们的初始名称分开它们?
谢谢!