-
Notifications
You must be signed in to change notification settings - Fork 142
Create README.md for css-typed-om #622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
darrnshn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, looks good overall. Just some small suggestions and typos.
css-typed-om/EXPLAINER.md
Outdated
| @@ -0,0 +1,117 @@ | |||
| # CSS Typed OM Explained | |||
|
|
|||
| CSS Typed OM is the extensable API for the CSSOM that reduces the burden of manipulating a CSS propeerty's value via string manipulation. It does so by exposing CSS values as typed JavaScript objects which help you circumvent the browser's CSS parser. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/extensable/extensible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/propeerty/property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not just the browser's CSS parser, but also JavaScript CSS parsers. Maybe something like "typed JavaScript objects to avoid string parsing", or even just "typed JavaScript objects rather than strings".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done * 3
css-typed-om/EXPLAINER.md
Outdated
|
|
||
| ## Motivation | ||
|
|
||
| The benefits of CSS Typed OM are as follows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/are as follows/include :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Sorry forgot to send this before.
|
|
||
| The benefits of CSS Typed OM are as follows: | ||
| * Allows the performant manipulation of values assigned to CSS properties. | ||
| * Being able to write more maintainable code: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe collapse this into two top level bullet points so it looks like there's more? :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol no :P
css-typed-om/EXPLAINER.md
Outdated
|
|
||
| ### Getting a property's value | ||
|
|
||
| To get specified and computed values for CSS properties of an element in CSSOM we get them via accessing them of the `.style` attribute on an element and the `getComputedStyle()` object respectively. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe somehow indicate that this is the old way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
css-typed-om/EXPLAINER.md
Outdated
|
|
||
| To get specified and computed values for CSS properties of an element in CSSOM we get them via accessing them of the `.style` attribute on an element and the `getComputedStyle()` object respectively. | ||
|
|
||
| In Typed OM we get them of `StylePropertyMaps` on elements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/of/from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
css-typed-om/EXPLAINER.md
Outdated
| ## Future Capabilities | ||
|
|
||
| The current specification doesn't have support for the following, however they are under consideration for Typed OM Level 2: | ||
| * Support for shorthand properties, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're gonna get shorthand for Level 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
css-typed-om/EXPLAINER.md
Outdated
|
|
||
| The current specification doesn't have support for the following, however they are under consideration for Typed OM Level 2: | ||
| * Support for shorthand properties, | ||
| * Support for gradients, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm planning to do gradients for level 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
css-typed-om/EXPLAINER.md
Outdated
| The current specification doesn't have support for the following, however they are under consideration for Typed OM Level 2: | ||
| * Support for shorthand properties, | ||
| * Support for gradients, | ||
| * Corresponding FontFaceValue for `@font-face` rules, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just put this as part of the next list as Fonts. I don't know if we're going to represent actual CSS rules as objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
css-typed-om/EXPLAINER.md
Outdated
| * Corresponding FontFaceValue for `@font-face` rules, | ||
| * Support for the following: | ||
| * Colors | ||
| * URLs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
URLs that are not images, since those are CSSImageValues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
css-typed-om/EXPLAINER.md
Outdated
| * Counters, | ||
| * etc. | ||
|
|
||
| ## Conclusion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe name this "Try it out!" or something exciting 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol Done
|
FWIW, if you name the file "README.md" instead of "EXPLAINER.md" you get an icon on the drafts home page linking to it (the "ⓘ"). |
nainar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
darrnshn@ made the changes you asked for.
css-typed-om/EXPLAINER.md
Outdated
| @@ -0,0 +1,117 @@ | |||
| # CSS Typed OM Explained | |||
|
|
|||
| CSS Typed OM is the extensable API for the CSSOM that reduces the burden of manipulating a CSS propeerty's value via string manipulation. It does so by exposing CSS values as typed JavaScript objects which help you circumvent the browser's CSS parser. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done * 3
|
|
||
| The benefits of CSS Typed OM are as follows: | ||
| * Allows the performant manipulation of values assigned to CSS properties. | ||
| * Being able to write more maintainable code: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol no :P
css-typed-om/EXPLAINER.md
Outdated
|
|
||
| ### Getting a property's value | ||
|
|
||
| To get specified and computed values for CSS properties of an element in CSSOM we get them via accessing them of the `.style` attribute on an element and the `getComputedStyle()` object respectively. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
css-typed-om/EXPLAINER.md
Outdated
|
|
||
| To get specified and computed values for CSS properties of an element in CSSOM we get them via accessing them of the `.style` attribute on an element and the `getComputedStyle()` object respectively. | ||
|
|
||
| In Typed OM we get them of `StylePropertyMaps` on elements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
css-typed-om/EXPLAINER.md
Outdated
|
|
||
| To get the specified height of an element we would use the following JS: | ||
| ``` | ||
| element.attributeStyleMap.get('height'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
css-typed-om/EXPLAINER.md
Outdated
| ## Future Capabilities | ||
|
|
||
| The current specification doesn't have support for the following, however they are under consideration for Typed OM Level 2: | ||
| * Support for shorthand properties, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
css-typed-om/EXPLAINER.md
Outdated
|
|
||
| The current specification doesn't have support for the following, however they are under consideration for Typed OM Level 2: | ||
| * Support for shorthand properties, | ||
| * Support for gradients, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
css-typed-om/EXPLAINER.md
Outdated
| The current specification doesn't have support for the following, however they are under consideration for Typed OM Level 2: | ||
| * Support for shorthand properties, | ||
| * Support for gradients, | ||
| * Corresponding FontFaceValue for `@font-face` rules, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
css-typed-om/EXPLAINER.md
Outdated
| * Corresponding FontFaceValue for `@font-face` rules, | ||
| * Support for the following: | ||
| * Colors | ||
| * URLs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
css-typed-om/EXPLAINER.md
Outdated
| * Counters, | ||
| * etc. | ||
|
|
||
| ## Conclusion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol Done
|
@plinss thanks - will change the name! |
darrnshn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but get Tab to take a look.
css-typed-om/README.md
Outdated
| @@ -0,0 +1,116 @@ | |||
| # CSS Typed OM Explained | |||
|
|
|||
| CSS Typed OM is the extensible API for the CSSOM that reduces the burden of manipulating a CSS property's value via string manipulation. It does so by exposing CSS values as typed JavaScript objects rather than strings. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe s/the/an? It's probably not the extensible API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
css-typed-om/README.md
Outdated
| ### Getting a property's value | ||
|
|
||
| In CSSOM land: | ||
| To get specified and computed values for CSS properties of an element in CSSOM we get them via accessing them of the `.style` attribute on an element and the `getComputedStyle()` object respectively. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe a comma between "in CSSOM" and "we get them"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
css-typed-om/README.md
Outdated
| element.computedStyleMap().get('height'); // returns a CSSUnitValue | ||
| ``` | ||
|
|
||
| ### Changing a propert's value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/propert/property
| #### CSSResourceValue | ||
|
|
||
| [CSSResourceValue](https://drafts.css-houdini.org/css-typed-om-1/#resourcevalue-objects) objects represent CSS values that require an asynchronous network fetch. Hence, they also describe the status the resource is in. Properties with image values (e.g. `background-image`), are represented by [CSSImageValues](https://drafts.css-houdini.org/css-typed-om-1/#cssimagevalue) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extraneous line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@darrnshn PTAL? Thanks!