Sha256: f3673f395a8b4010e283208ed92c4fd3731f30e6ae07e86f40b3d5b6d3a5f738

Contents?: true

Size: 1.49 KB

Versions: 4

Compression:

Stored size: 1.49 KB

Contents

CSSStyleDeclaration
===================

CSSStyleDeclaration is a work-a-like to the CSSStyleDeclaration class in Nikita Vasilyev's [CSSOM](https://github.com/NV/CSSOM). I made it so that when using [jQuery in node](https://github.com/tmtk75/node-jquery) setting css attributes via $.fn.css() would work. node-jquery uses [jsdom](https://github.com/tmpvar/jsdom) to create a DOM to use in node. jsdom uses CSSOM for styling, and CSSOM's implementation of the [CSSStyleDeclaration](http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration) doesn't support [CSS2Properties](http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSS2Properties), which is how jQuery's [$.fn.css()](http://api.jquery.com/css/) operates.


Why not just issue a pull request?
----
Well, NV wants to keep CSSOM fast (which I can appreciate) and CSS2Properties aren't required by the standard (though every browser has the interface). So I figured the path of least resistence would be to just modify this one class, publish it as a node module (that requires CSSOM) and then make a pull request of jsdom to use it.

How do I test this code?
---
`npm test` should do the trick, assuming you have the dev dependencies installed:
> ```
> $ npm test
>
> tests
> ✔ Verify Has Properties
> ✔ Verify Has Functions
> ✔ Verify Has Special Properties
> ✔ Test From Style String
> ✔ Test From Properties
> ✔ Test Shorthand Properties
> ✔ Test width and height Properties and null and empty strings
> ✔ Test Implicit Properties
> ```

Version data entries

4 entries across 4 versions & 4 rubygems

Version Path
learn_create-0.0.22 lib/templates/javascript_lab_template/node_modules/cssstyle/README.md
locomotivecms-3.4.0 app/javascript/node_modules/jest-environment-jsdom/node_modules/cssstyle/README.md
lanes-0.8.0 node_modules/cssstyle/README.md
select_all-rails-0.3.1 node_modules/cssstyle/README.md