Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 2062 Bytes
1 | module Sass::Tree |
2 | # A static node representing an unproccessed Sass `@`-directive. |
3 | # Directives known to Sass, like `@for` and `@debug`, |
4 | # are handled by their own nodes; |
5 | # only CSS directives like `@media` and `@font-face` become {DirectiveNode}s. |
6 | # |
7 | # `@import` is a bit of a weird case; |
8 | # it becomes an {ImportNode}. |
9 | # |
10 | # @see Sass::Tree |
11 | class DirectiveNode < Node |
12 | # The text of the directive, `@` and all. |
13 | # |
14 | # @return [String] |
15 | attr_accessor :value |
16 | |
17 | # @param value [String] See \{#value} |
18 | def initialize(value) |
19 | @value = value |
20 | super() |
21 | end |
22 | |
23 | # Computes the CSS for the directive. |
24 | # |
25 | # @param tabs [Fixnum] The level of indentation for the CSS |
26 | # @return [String] The resulting CSS |
27 | def to_s(tabs) |
28 | if children.empty? |
29 | value + ";" |
30 | else |
31 | result = if style == :compressed |
32 | "#{value}{" |
33 | else |
34 | "#{' ' * (tabs - 1)}#{value} {" + (style == :compact ? ' ' : "\n") |
35 | end |
36 | was_prop = false |
37 | first = true |
38 | children.each do |child| |
39 | next if child.invisible? |
40 | if style == :compact |
41 | if child.is_a?(PropNode) |
42 | result << "#{child.to_s(first || was_prop ? 1 : tabs + 1)} " |
43 | else |
44 | if was_prop |
45 | result[-1] = "\n" |
46 | end |
47 | rendered = child.to_s(tabs + 1) |
48 | rendered.lstrip! if first |
49 | result << rendered |
50 | end |
51 | was_prop = child.is_a?(PropNode) |
52 | first = false |
53 | elsif style == :compressed |
54 | result << (was_prop ? ";#{child.to_s(1)}" : child.to_s(1)) |
55 | was_prop = child.is_a?(PropNode) |
56 | else |
57 | result << child.to_s(tabs + 1) + "\n" |
58 | end |
59 | end |
60 | result.rstrip + if style == :compressed |
61 | "}" |
62 | else |
63 | (style == :expanded ? "\n" : " ") + "}\n" |
64 | end |
65 | end |
66 | end |
67 | end |
68 | end |