@anydigital/breakout-css 1.0.0-alpha.3 → 1.0.0-alpha.5
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 +20 -2
- package/dist/breakout.css +1 -1
- package/package.json +3 -2
- package/postcss.config.js +12 -0
- package/src/breakout.css +2 -2
package/README.md
CHANGED
|
@@ -40,15 +40,18 @@ The breakout effect automatically applies to:
|
|
|
40
40
|
- `img`, `figure`, `picture`
|
|
41
41
|
- `video`, `audio`
|
|
42
42
|
- `iframe`, `object`, `embed`, `canvas`
|
|
43
|
-
-
|
|
43
|
+
- `table`, `pre`
|
|
44
|
+
- Elements with `.breakout-item` or `.breakout-item-max` class
|
|
44
45
|
|
|
45
46
|
### Manual Breakout
|
|
46
47
|
|
|
48
|
+
For elements that don't automatically break out, use the `.breakout-item` class:
|
|
49
|
+
|
|
47
50
|
```html
|
|
48
51
|
<div class="breakout">
|
|
49
52
|
<p>Regular content...</p>
|
|
50
53
|
|
|
51
|
-
<div class="breakout-
|
|
54
|
+
<div class="breakout-item">
|
|
52
55
|
<iframe src="https://example.com/embed"></iframe>
|
|
53
56
|
</div>
|
|
54
57
|
|
|
@@ -56,6 +59,21 @@ The breakout effect automatically applies to:
|
|
|
56
59
|
</div>
|
|
57
60
|
```
|
|
58
61
|
|
|
62
|
+
### Force Maximum Width
|
|
63
|
+
|
|
64
|
+
By default, breakout elements auto-size between 100% and 125% width. To force an element to always use the full 125% breakout width, use `.breakout-item-max`:
|
|
65
|
+
|
|
66
|
+
```html
|
|
67
|
+
<div class="breakout">
|
|
68
|
+
<p>Regular content...</p>
|
|
69
|
+
|
|
70
|
+
<!-- This will always be 125% width, never smaller -->
|
|
71
|
+
<img src="wide-image.jpg" class="breakout-item-max" alt="Wide image">
|
|
72
|
+
|
|
73
|
+
<p>More content...</p>
|
|
74
|
+
</div>
|
|
75
|
+
```
|
|
76
|
+
|
|
59
77
|
## How It Works
|
|
60
78
|
|
|
61
79
|
The breakout effect is achieved by:
|
package/dist/breakout.css
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
/* Max out the width of the element */
|
|
26
26
|
|
|
27
27
|
.breakout > .breakout-item-max:not(does-not-exist),.breakout > p > .breakout-item-max {
|
|
28
|
-
width: 125
|
|
28
|
+
width: 125% !important; /* @TODO: !important for cases like figure.breakout-item-max */
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
/* @TODO: Allow non-direct children. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anydigital/breakout-css",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.5",
|
|
4
4
|
"description": "Modern CSS utilities to easily break-out / hang / pop-out images, iframes, or other figures from their parent container",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
],
|
|
14
14
|
"files": [
|
|
15
15
|
"dist",
|
|
16
|
-
"src"
|
|
16
|
+
"src",
|
|
17
|
+
"postcss.config.js"
|
|
17
18
|
],
|
|
18
19
|
"exports": {
|
|
19
20
|
".": "./src/breakout.css",
|
package/src/breakout.css
CHANGED