mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
[Sass] Document a few undocumented methods.
This commit is contained in:
parent
8ad55a6e26
commit
4294ac51a3
3 changed files with 22 additions and 2 deletions
|
@ -308,6 +308,10 @@ module Sass
|
|||
res
|
||||
end
|
||||
|
||||
# Returns `nil` if this is a pseudoclass selector
|
||||
# and `sels` contains a pseudoclass selector different than this one.
|
||||
#
|
||||
# @see Selector#unify
|
||||
def unify(sels)
|
||||
return if type == :element && sels.any? do |sel|
|
||||
sel.is_a?(Pseudo) && sel.type == :element &&
|
||||
|
|
|
@ -1,12 +1,23 @@
|
|||
require 'sass/tree/node'
|
||||
|
||||
module Sass::Tree
|
||||
# A static node reprenting an `@extend` directive.
|
||||
#
|
||||
# @see Sass::Tree
|
||||
class ExtendNode < Node
|
||||
# @param selector [Array<String, Sass::Script::Node>]
|
||||
# The CSS selector to extend,
|
||||
# interspersed with {Sass::Script::Node}s
|
||||
# representing `#{}`-interpolation.
|
||||
def initialize(selector)
|
||||
@selector = selector
|
||||
super()
|
||||
end
|
||||
|
||||
# Registers this extension in the `extends` subset map.
|
||||
#
|
||||
# @param parent [RuleNode] The parent node of this node
|
||||
# @see Node#cssize
|
||||
def cssize(extends, parent)
|
||||
@resolved_selector.members.each do |seq|
|
||||
if seq.members.size > 1
|
||||
|
@ -33,6 +44,11 @@ module Sass::Tree
|
|||
|
||||
protected
|
||||
|
||||
# Runs SassScript interpolation in the selector,
|
||||
# and then parses the result into a {Sass::Selector::CommaSequence}.
|
||||
#
|
||||
# @param environment [Sass::Environment] The lexical environment containing
|
||||
# variable and mixin values
|
||||
def perform!(environment)
|
||||
@resolved_selector = Sass::SCSS::CssParser.new(run_interp(@selector, environment)).
|
||||
parse_selector(self.line, self.filename)
|
||||
|
|
|
@ -185,8 +185,8 @@ module Sass::Tree
|
|||
to_return
|
||||
end
|
||||
|
||||
# Runs any SassScript that may be embedded in the rule,
|
||||
# and parses the selectors for commas.
|
||||
# Runs SassScript interpolation in the selector,
|
||||
# and then parses the result into a {Sass::Selector::CommaSequence}.
|
||||
#
|
||||
# @param environment [Sass::Environment] The lexical environment containing
|
||||
# variable and mixin values
|
||||
|
|
Loading…
Add table
Reference in a new issue