English 中文(简体)
CSS 2 Sass: 我如何改变产生的特别安全局的产出格式?
原标题:CSS 2 Sass: How do I change the output format of the generated SCSS?
  • 时间:2010-07-07 03:48:49
  •  标签:
  • css
  • ruby
  • sass

我想将特别安全局改为特别安全局。

.top {
  margin-top: 1em;
  margin-bottom: 1em;
  nav {
    background: #333;
  }
  ul {
    padding: 0;
    display: table-row;
  }
  li {
    display: table-cell;
  }
}

相反,我正在这样做:

.top {
  margin-top: 1em;
  margin-bottom: 1em;
  nav {
    background: #333; }
  ul {
    padding: 0;
    display: table-row; }
  li {
    display: table-cell; } }

我如何改变指挥部门的产出缩减:

sass-convert public/stylesheets/application.css public/stylesheets/application.scss

感谢!

最佳回答

根据docs(在指挥线上检查 s湖)的说法,在从 c到 s(或 s)时,不可能改变产出风格。

问题回答

我也存在同样的问题,因此,我使用了以下几句子做一些后处理,并将产生的产出固定到<代码>:expanded output风格:

import sys
    import re

path = sys.argv[1]

scss = open(path).read()

# Fix up the indentation of closing braces to use a :expanded rather than :nested style.
scss = re.sub(r 	(	*)([^}
]*;) (}.*) , r 	12
13 , scss)
for i in range(0, 10):
    # This line is executed multiple times to fix up multiple closing braces on a single line.
    scss = re.sub(r 	(	*)};? } , r 	1}
1} , scss)

open(path,  w ).write(scss)

http://css2sass.heroku.com/rel=“nofollow”http://cs2sass.heroku.com/

我已利用这一方法将特别安全局改为特别安全局。





相关问题
Ruby parser in Java

The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...

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 ...

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?

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

multiple ruby extension modules under one directory

Can sources for discrete ruby extension modules live in the same directory, controlled by the same extconf.rb script? Background: I ve a project with two extension modules, foo.so and bar.so which ...

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 ...

热门标签