Class: Graphite::Importer

Inherits:
Sass::Importers::Filesystem
  • Object
show all
Defined in:
lib/graphite/importer.rb

Constant Summary collapse

FONT_EXTENSIONS =
[
    "eot",
    "woff2",
    "woff",
    "otf",
    "ttf",
    "svg"
]
FONT_WEIGHTS =
[
    "100",
    "200",
    "300",
    "400",
    "500",
    "600",
    "700",
    "800",
    "900"
]
FONT_STYLES =
[
    "normal",
    "italic",
    "oblique"
]

Instance Method Summary collapse

Instance Method Details

#find(name, options) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/graphite/importer.rb', line 34

def find(name, options)
    if options[:css_filename]
        if name.include? "?styles="
            find_fonts(name, options[:css_filename], options)
        else
            super(name, options)
        end
    else
        nil
    end
end

#key(name, options) ⇒ Object



46
47
48
# File 'lib/graphite/importer.rb', line 46

def key(name, options)
     ["Graphite:" + File.dirname(File.expand_path(name)), File.basename(name)]
end

#to_sObject



50
51
52
# File 'lib/graphite/importer.rb', line 50

def to_s
    "Graphite::Importer"
end