react-outline 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -53
- package/dist/reactOutline.js +1 -231
- package/dist/reactOutline.js.map +4 -4
- package/package.json +8 -9
- package/dist/Styles.js +0 -45
- package/dist/element.js +0 -141
- package/dist/main.js +0 -64
- package/dist/styleItem.js +0 -168
- package/dist/utils/buildCssString.js +0 -14
- package/dist/utils/genCss.js +0 -27
- package/dist/utils/genStyles.js +0 -23
- package/dist/utils/hasKids.js +0 -12
- package/dist/utils/index.js +0 -83
- package/dist/utils/makeid.js +0 -13
- package/dist/utils/object2css.js +0 -25
- package/dist/utils/pubsub.js +0 -40
- package/dist/utils/replaceColors.js +0 -16
- package/dist/utils/replacedStyleFn.js +0 -35
- package/dist/utils/sanitizeOutlineInput.js +0 -70
- package/dist/utils/separateCssStyle.js +0 -23
- package/dist/wrapStyles.js +0 -38
package/README.md
CHANGED
|
@@ -8,7 +8,10 @@ react-outline was designed to more easly manage inline styles and better support
|
|
|
8
8
|
|
|
9
9
|
[](https://badge.fury.io/js/react-outline)
|
|
10
10
|
[](https://github.com/codemeasandwich/react-outline/actions/workflows/publish.yml)
|
|
11
|
-
[](https://coveralls.io/github/codemeasandwich/react-outline?branch=v2.1.3)
|
|
12
|
+
[](https://github.com/codemeasandwich/react-outline/issues)
|
|
13
|
+
[](https://bundlephobia.com/package/react-outline)
|
|
14
|
+
[](https://snyk.io/test/github/codemeasandwich/react-outline)
|
|
12
15
|
|
|
13
16
|
|
|
14
17
|
Feathers:
|
|
@@ -22,60 +25,9 @@ Feathers:
|
|
|
22
25
|
|
|
23
26
|
# [Live Demo](https://s3.amazonaws.com/react-outline/index.html?down=0) / [Demo Source](https://github.com/codemeasandwich/react-outline/tree/master/example)
|
|
24
27
|
|
|
25
|
-
## Storybook Examples
|
|
26
|
-
|
|
27
|
-
### Basics
|
|
28
|
-
| Example | Description |
|
|
29
|
-
|---------|-------------|
|
|
30
|
-
| [Creating and applying a style](#creating-and-applying-a-style--basic-example-) | Define styles object, process with `outline()`, apply via `styles.title()` |
|
|
31
|
-
| [Generate element from style](#the-above-example-can-be-streamlined-using-the-tag-creater) | Use tagged template `styles.title\`div\`` to create styled components |
|
|
32
|
-
| [Wrapping existing elements](https://s3.amazonaws.com/react-outline/index.html?selectedKind=Basics&selectedStory=Wrapping%20an%20existing%20element) | Wrap React components: `styles.title\`${MyComponent}\`` |
|
|
33
|
-
| [Implied named elements](https://s3.amazonaws.com/react-outline/index.html?selectedKind=Basics&selectedStory=Generate%20an%20implied%20named%20element) | Style names matching HTML tags auto-infer element type |
|
|
34
|
-
| [Reusing elements](https://s3.amazonaws.com/react-outline/index.html?selectedKind=Basics&selectedStory=Reusing%20elements) | Use styled components multiple times |
|
|
35
|
-
| [Passing Style and Function](https://s3.amazonaws.com/react-outline/index.html?selectedKind=Basics&selectedStory=Passing%20Style%20and%20Funtion%20as%20arguments) | Pass styles and functions as separate args: `outline(styles, fns)` |
|
|
36
|
-
| [Sharing styles](https://s3.amazonaws.com/react-outline/index.html?selectedKind=Basics&selectedStory=Sharing%20Style) | Share across elements: `"title, content": { textShadow: "..." }` |
|
|
37
|
-
|
|
38
|
-
### Combine Styles
|
|
39
|
-
| Example | Description |
|
|
40
|
-
|---------|-------------|
|
|
41
|
-
| [Using style function](#the-attribute-flag-can-be-used-via-the-style-function) | Call with flags: `styles.title({error: true})` |
|
|
42
|
-
| [In generated element](#you-can-combine-attribute-of-a-style-by-using-a-boolean-flag) | Via style prop: `<Title style={{error:true}}>` |
|
|
43
|
-
| [Prop flags](https://s3.amazonaws.com/react-outline/index.html?selectedKind=Combine%20styles&selectedStory=Using%20a%20prop%20flag) | Boolean props: `<Title error>` |
|
|
44
|
-
| [Custom colors](https://s3.amazonaws.com/react-outline/index.html?selectedKind=Combine%20styles&selectedStory=Logic%20function%20With%20Generate%20Element) | Use `withOptions({colors:{...}})` for color mappings |
|
|
45
|
-
| [Pass style objects](https://s3.amazonaws.com/react-outline/index.html?selectedKind=Combine%20styles&selectedStory=Passing%20a%20Style%20objct%20to%20a%20generated%20element) | Raw CSS: `<Title style={{color:"red"}}>` |
|
|
46
|
-
|
|
47
|
-
### Style Functions
|
|
48
|
-
| Example | Description |
|
|
49
|
-
|---------|-------------|
|
|
50
|
-
| [Dynamic styles](#redux-outline-also-support-custom-function-to-have-run-time-control-over-your-styles) | Runtime computed styles via functions |
|
|
51
|
-
| [Modify existing styles](https://s3.amazonaws.com/react-outline/index.html?selectedKind=Style%20Functions&selectedStory=Modify%20existing%20styles) | 2-arg functions: `(style, props) => ({...})` |
|
|
52
|
-
| [Function without style](https://s3.amazonaws.com/react-outline/index.html?selectedKind=Style%20Functions&selectedStory=Function%20dont%20need%20a%20style) | Functions work without matching base style |
|
|
53
|
-
| [With generated elements](https://s3.amazonaws.com/react-outline/index.html?selectedKind=Style%20Functions&selectedStory=Function%20with%20generated%20elements) | Pass args via style prop: `<Group style={data.length}>` |
|
|
54
|
-
|
|
55
|
-
### CSS Helpers
|
|
56
|
-
| Example | Description |
|
|
57
|
-
|---------|-------------|
|
|
58
|
-
| [Media queries](https://s3.amazonaws.com/react-outline/index.html?selectedKind=CSS%20Helpers&selectedStory=Media%20Query) | `"@media (max-width: 600px)": {...}` - requires `<Styles/>` |
|
|
59
|
-
| [Hover states](https://s3.amazonaws.com/react-outline/index.html?selectedKind=CSS%20Helpers&selectedStory=Mouse%20hover) | `":hover": {...}` - requires `<Styles/>` |
|
|
60
|
-
| [CSS source](https://s3.amazonaws.com/react-outline/index.html?selectedKind=CSS%20Helpers&selectedStory=Css%20Source) | Raw CSS strings in `<Styles>` component |
|
|
61
|
-
| [CSS selectors](https://s3.amazonaws.com/react-outline/index.html?selectedKind=CSS%20Helpers&selectedStory=Css%20Selector) | Child selectors: `"div:nth-child(even)": {...}` |
|
|
62
|
-
| [Dynamic CSS](https://s3.amazonaws.com/react-outline/index.html?selectedKind=CSS%20Helpers&selectedStory=Dynamic%20Css%20Selector) | Runtime via `css` prop |
|
|
63
|
-
| [Vendor prefixes](https://s3.amazonaws.com/react-outline/index.html?selectedKind=CSS%20Helpers&selectedStory=Vendor%20Auto-Prefix) | Auto-prefixes for flex, transitions, etc. |
|
|
64
|
-
|
|
65
|
-
### Reference DOM Element
|
|
66
|
-
| Example | Description |
|
|
67
|
-
|---------|-------------|
|
|
68
|
-
| [DOM events](https://s3.amazonaws.com/react-outline/index.html?selectedKind=Reference%20dom%20element&selectedStory=function%20with%20Dom%20Events) | `onDomEvent={{'scroll': handler}}` |
|
|
69
|
-
| [Ref by function](https://s3.amazonaws.com/react-outline/index.html?selectedKind=Reference%20dom%20element&selectedStory=ref%20by%20function) | Access DOM via React refs |
|
|
70
|
-
|
|
71
|
-
### Animate
|
|
72
|
-
| Example | Description |
|
|
73
|
-
|---------|-------------|
|
|
74
|
-
| [Animate.css](https://s3.amazonaws.com/react-outline/index.html?selectedKind=Animate&selectedStory=Animate.css) | Integration with ReactCSSTransitionGroup |
|
|
75
|
-
|
|
76
28
|
---
|
|
77
29
|
|
|
78
|
-
##
|
|
30
|
+
## Where to start?
|
|
79
31
|
|
|
80
32
|
1. [Creating and applying a style](#creating-and-applying-a-style--basic-example-)
|
|
81
33
|
2. [Generate a element from a style](#the-above-example-can-be-streamlined-using-the-tag-creater)
|