Class: Assette::Reader::Css

Inherits:
Object
  • Object
show all
Defined in:
lib/assette/readers/css.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.comment_strObject



28
29
30
# File 'lib/assette/readers/css.rb', line 28

def comment_str
  '/* %s */'
end

.error(str, stack = nil) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/assette/readers/css.rb', line 9

def error str, stack = nil
  "  body:before {\n    position: absolute;\n    top: 0px;\n    padding: 10px;\n    font-size: 18px;\n    text-align: center;\n    width: 100%;\n    display: block;\n    content: \#{str.inspect};\n    background-color: #992E40;\n    color: white;\n    font-weight:bold;\n    z-index: 9999;\n  }\n  CSS\nend\n"

.include(path) ⇒ Object



38
39
40
41
42
43
# File 'lib/assette/readers/css.rb', line 38

def include path
  "    \#{comment_str % path}\n    @import url(\"\#{path}?nodep\");\n  CSS\nend\n"

.tag(path) ⇒ Object



32
33
34
35
36
# File 'lib/assette/readers/css.rb', line 32

def tag path
  "    <link href=\"\#{path}\" rel=\"stylesheet\" type=\"text/css\"  media=\"all\" />\n  HTML\nend\n"

Instance Method Details

#compileObject



3
4
5
# File 'lib/assette/readers/css.rb', line 3

def compile
  @file.text
end