Tag: css

如何在Rails 4中缩小CSS?

我尝试了以下内容,但是我看看CSS源代码并没有缩小! 我重启了服务器几十次。 我在浏览器中关闭了缓存。 我也试过’yui-compressor’gem。 配置/环境/ development.rb config.assets.debug = false config.assets.css_compressor = :sass config.assets.compile = true 的Gemfile group :assets do # Add any compass extensions here # Use SCSS for stylesheets gem ‘sass-rails’, ‘~> 4.0.0’ 参考 http://edgeguides.rubyonrails.org/asset_pipeline.html#customizing-the-pipeline 版 WEBrick 1.3.1,ruby 2.0.0(2013-06-27)[i386-mingw32],Rails 4.0.3

与gulp-ruby-sass一起吞咽:错误:../ style.css.map:3:1:未知单词

使用基本的gulp / express构建手表获得奇怪的错误。 目录布局 project/ – sass/ – style.scss – gulpfile.js – index.html Gulpfile.js var gulp = require(‘gulp’), sass = require(‘gulp-ruby-sass’), autoprefixer = require(‘gulp-autoprefixer’), minifycss = require(‘gulp-minify-css’), rename = require(‘gulp-rename’); gulp.task(‘express’, function() { var express = require(‘express’); var app = express(); app.use(require(‘connect-livereload’)({port: 4002})); app.use(express.static(__dirname)); app.listen(4000); }); var tinylr; gulp.task(‘livereload’, function() { tinylr = require(‘tiny-lr’)(); tinylr.listen(4002); […]

部署到Heroku后未加载更新的CSS样式表?

这对我来说已经有一段时间了,但是我仍然无法弄清楚Rails 4中的资产管道是如何工作的。我终于学会了如何预编译资产,但是在部署之后,我的CSS样式表再次没有了得到更新。 我通过访问开发人员工具并查看源来确认了这一点。 它看起来与我的CSS文件不同。 我的猜测是问题在于我的production.rb文件。 Production.rb Games::Application.configure do config.cache_classes = true config.eager_load = true config.consider_all_requests_local = false config.action_controller.perform_caching = true config.serve_static_assets = true config.assets.js_compressor = :uglifier config.assets.compile = true config.assets.digest = true config.assets.version = ‘1.0’ config.log_level = :info config.i18n.fallbacks = true config.active_support.deprecation = :notify config.log_formatter = ::Logger::Formatter.new end application.rb中 require File.expand_path(‘../boot’, __FILE__) require ‘rails/all’ Bundler.require(*Rails.groups) […]

如何在SCSS中使用类获取相同的对象?

我有这个代码: input[type=”text”] { color: red; .blue { color: blue; } } 这给了我这个 input[type=”text”] { color: red } input[type=”text”] .blue { color: blue; } 我怎么得到这样的东西? input[type=”text”] { color: red } input[type=”text”].blue { color: blue; }

在Sass和指南针的背景图象道路

这在config.rb文件中提到 images_dir = “images” 我在图像文件夹中的项目中使用2个文件夹作为图像 images images/background/ images/content/ 如果images/background/文件夹中有任何图像,那么我应该如何在css background和Sass变量中添加图像路径? $header-img: “sass.gif”; 和 background-image: url(‘sass.gif?1327592426’); 以及如何从每个背景图像中摆脱这种自动生成的?1327592426 ?

在scss文件中使用config.rb中定义的变量

是否可以在整个SCSS文件中使用罗盘项目的config.rb文件中定义的变量?

在rails 3中使用button_to“delete”的bootstrap图标

我有这个编辑按钮: 我希望删除按钮看起来与此图标相同:glyphicon glyphicon-trash,但我找不到合适的语法使其工作并且看起来一样。 我的删除按钮现在: :delete, :remote=> true %>