| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library polymer.src.css_emitters; | 5 library polymer.src.css_emitters; |
| 6 | 6 |
| 7 import 'package:csslib/visitor.dart' show Visitor, CssPrinter, ElementSelector, | 7 import 'package:csslib/visitor.dart' show Visitor, CssPrinter, ElementSelector, |
| 8 UriTerm, Selector, HostDirective, SimpleSelectorSequence, StyleSheet; | 8 UriTerm, Selector, HostDirective, SimpleSelectorSequence, StyleSheet; |
| 9 | 9 |
| 10 import 'info.dart'; | 10 import 'info.dart'; |
| 11 import 'utils.dart'; | |
| 12 | 11 |
| 13 | 12 |
| 14 /** Emit the contents of the style tag outside of a component. */ | 13 /** Emit the contents of the style tag outside of a component. */ |
| 15 String emitStyleSheet(StyleSheet ss, FileInfo file) => | 14 String emitStyleSheet(StyleSheet ss, FileInfo file) => |
| 16 (new _CssEmitter(file.components.keys.toSet()) | 15 (new _CssEmitter(file.components.keys.toSet()) |
| 17 ..visitTree(ss, pretty: true)).toString(); | 16 ..visitTree(ss, pretty: true)).toString(); |
| 18 | 17 |
| 19 /** Emit a component's style tag content emulating scoped css. */ | 18 /** Emit a component's style tag content emulating scoped css. */ |
| 20 String emitComponentStyleSheet(StyleSheet ss, String tagName) => | 19 String emitComponentStyleSheet(StyleSheet ss, String tagName) => |
| 21 (new _ComponentCssEmitter(tagName)..visitTree(ss, pretty: true)).toString(); | 20 (new _ComponentCssEmitter(tagName)..visitTree(ss, pretty: true)).toString(); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 void visitHostDirective(HostDirective node) { | 111 void visitHostDirective(HostDirective node) { |
| 113 _inHostDirective = true; | 112 _inHostDirective = true; |
| 114 emit('/* @host */'); | 113 emit('/* @host */'); |
| 115 for (var ruleset in node.rulesets) { | 114 for (var ruleset in node.rulesets) { |
| 116 ruleset.visit(this); | 115 ruleset.visit(this); |
| 117 } | 116 } |
| 118 _inHostDirective = false; | 117 _inHostDirective = false; |
| 119 emit('/* end of @host */\n'); | 118 emit('/* end of @host */\n'); |
| 120 } | 119 } |
| 121 } | 120 } |
| OLD | NEW |