English 中文(简体)
是否有办法将特别安全系统预处理器扩大到任意操纵申报的每一项财产?
原标题:Is there a way to extend the SASS preprocessor to manipulate arbitrarily each declared property?

我正在开发一个嵌入式部件, 该部件需要将其所有 CSS 属性声明为对于防止 CSS 嵌入页面流血非常重要 。 这意味着, 如果我想使用一些已有的 CSS 框架( 如布茨陷阱), 或者一些使用 CSS 样式表的 jQuery 插件, 我就必须手工将 CSS 复制到资产文件夹中, 并对每个属性添加 < code>! 重要的 声明 。 这似乎是一个相当无法保存且容易出错的过程 。

每个标题 < 坚固>, 是否有办法将 SASS 预处理器扩展为 < code>! 重要的 , 添加到任何已申报的属性, 用于导入文件或部分内容?

问题回答

No, Sass doesn t have that functionality, because it is the most uncommon thing you would want to do in Sass, or CSS, or anywhere for that matter.

However, from what I understand, you want to add in the !important to all the CSS properties in a particular file. In that case, you can just simply do a Search & Replace: Search for ; and replace with !important;

最明显的解决方案是创建一个新的混合剂,可能以以下词“code> important

%margin-none-important {
    margin: 0 !important;
}

然后在你的代码中:

.no-margin {
    @extend %margin-none-important;
}




相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签