Skip to content

Instantly share code, notes, and snippets.

@chalin
Created May 24, 2016 18:25
Show Gist options
  • Save chalin/b7e284973e534eff5294b2bd9eb0239c to your computer and use it in GitHub Desktop.
Save chalin/b7e284973e534eff5294b2bd9eb0239c to your computer and use it in GitHub Desktop.
HtmlElement `style` property naming in Dart
import 'dart:html';
void main() {
var div = document.createElement('div');
print('1. div.style.fontSize = ${div.style.fontSize}');
div.style.fontSize = "120%";
print('2. div.style.fontSize = ${div.style.fontSize}');
/*
* div.style[] results in warning:
* The operator '[]=' is not defined for the class 'CssStyleDeclaration'.
*/
// div.style['fontSize'] = "130%";
// div.style['font-size'] = "140%";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment