diff --git a/README.md b/README.md index 9f78537..88d6f0d 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ TypeScript and Flow definitions for CSS, generated by [data from MDN](https://gi **TypeScript** ```ts -import * as CSS from 'csstype'; +import type * as CSS from 'csstype'; const style: CSS.Properties = { colour: 'white', // Type error on property @@ -121,7 +121,7 @@ All interfaces has two optional generic argument to define length and time: `CSS ## Usage ```ts -import * as CSS from 'csstype'; +import type * as CSS from 'csstype'; const style: CSS.Properties = { width: '10px', @@ -132,7 +132,7 @@ const style: CSS.Properties = { In some cases, like for CSS-in-JS libraries, an array of values is a way to provide fallback values in CSS. Using `CSS.PropertiesFallback` instead of `CSS.Properties` will add the possibility to use any property value as an array of values. ```ts -import * as CSS from 'csstype'; +import type * as CSS from 'csstype'; const style: CSS.PropertiesFallback = { display: ['-webkit-flex', 'flex'], @@ -143,7 +143,7 @@ const style: CSS.PropertiesFallback = { There's even string literals for pseudo selectors and elements. ```ts -import * as CSS from 'csstype'; +import type * as CSS from 'csstype'; const pseudos: { [P in CSS.SimplePseudos]?: CSS.Properties } = { ':hover': { @@ -155,7 +155,7 @@ const pseudos: { [P in CSS.SimplePseudos]?: CSS.Properties } = { Hyphen cased (kebab cased) properties are provided in `CSS.PropertiesHyphen` and `CSS.PropertiesHyphenFallback`. It's not **not** added by default in `CSS.Properties`. To allow both of them, you can simply extend with `CSS.PropertiesHyphen` or/and `CSS.PropertiesHyphenFallback`. ```ts -import * as CSS from 'csstype'; +import type * as CSS from 'csstype'; interface Style extends CSS.Properties, CSS.PropertiesHyphen {} @@ -170,7 +170,7 @@ const style: Style = { Adding type checked CSS properties to a `HTMLElement`. ```ts -import * as CSS from 'csstype'; +import type * as CSS from 'csstype'; const style: CSS.Properties = { color: 'red', @@ -200,7 +200,7 @@ _If you're using CSS Custom Properties you can step directly to step 3._ ```ts // My css.d.ts file - import * as CSS from 'csstype'; + import type * as CSS from 'csstype'; declare module 'csstype' { interface Properties {