Package com.bazaarvoice.jless.ast.node

Examples of com.bazaarvoice.jless.ast.node.RuleSetNode


        private void surroundPropertyGroups() {
            while (!_propertyGroups.empty()) {
                PropertyGroup group = _propertyGroups.pop();

                // Construct a simple rule set using the parent's selector
                RuleSetNode propertyRuleSet = new RuleSetNode();
                propertyRuleSet.addChild(NodeTreeUtils.filterLineBreaks(_parentSelectorGroup.clone()));

                // Move all the properties into this new rule set
                List<Node> propertyNodes = new ArrayList<Node>(_parentScope.getChildren().subList(group.getStart(), group.getEnd() + 1));
                propertyRuleSet.addChild(new ScopeNode(propertyNodes));

                // Insert the property rule set
                _parentScope.addChild(group.getStart(), propertyRuleSet);
            }
        }
View Full Code Here


    Rule RuleSet() {
        return Sequence(
                FirstOf(
                        // Standard CSS rule set
                        Sequence(
                                SelectorGroup(), push(new RuleSetNode(pop())),
                                '{',
                                Scope(), peek(1).addChild(pop()), Ws0()
                        ),
                        // Mixin rule set, with possible arguments
                        Sequence(
                                ClassSelectorGroup(), push(new RuleSetNode(pop())), Ws0(),
                                Parameters(), Ws0(),
                                '{',
                                Scope(), peek(1).addChild(pop()), peek(1).addChild(pop()), Ws0()
                        )
                ),
View Full Code Here

            if (!(node instanceof ScopeNode)) {
                continue;
            }

            ScopeNode scope = (ScopeNode) node;
            RuleSetNode ruleSet = scope.getRuleSet(name);

            if (ruleSet == null) {
                continue;
            }
View Full Code Here

            List<RuleSetNode> nestedRuleSets = NodeTreeUtils.getAndRemoveChildren(mediaScopeNode, RuleSetNode.class);

            // if scope node for media query has anything more but whitespaces and rule sets than wrap it with rule set with the same selector group as outer rule set has
            if (mediaScopeNode.getChildren().size() > NodeTreeUtils.getChildren(mediaScopeNode, WhiteSpaceCollectionNode.class).size()) {
                RuleSetNode newRuleSetNode = new RuleSetNode();
                ScopeNode newScopeNode = new ScopeNode();
                newRuleSetNode.addChild(selectorGroupNode.clone());
                newRuleSetNode.addChild(newScopeNode);

                NodeTreeUtils.moveChildren(mediaScopeNode, newScopeNode);

                mediaScopeNode.clearChildren();
                mediaScopeNode.addChild(newRuleSetNode);
View Full Code Here

TOP

Related Classes of com.bazaarvoice.jless.ast.node.RuleSetNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.