@anydigital/atomic-bricks 1.0.0-alpha → 1.0.0-alpha.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 +12 -0
- package/dist/atomic-bricks.css +32 -0
- package/package.json +6 -4
- package/src/_base.css +5 -0
- package/src/atomic-bricks.css +2 -5
package/README.md
CHANGED
|
@@ -36,6 +36,18 @@ html, body {
|
|
|
36
36
|
|
|
37
37
|
This is automatically applied when you include the stylesheet.
|
|
38
38
|
|
|
39
|
+
### Breakout CSS
|
|
40
|
+
|
|
41
|
+
Includes [breakout-css](https://github.com/anydigital/breakout-css) utilities for breaking out images and figures beyond their container width. Use the `.breakout` class to allow elements to extend beyond their parent container:
|
|
42
|
+
|
|
43
|
+
```html
|
|
44
|
+
<div class="breakout">
|
|
45
|
+
<img src="image.jpg" alt="Description">
|
|
46
|
+
</div>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The breakout utilities support images, pictures, figures, canvas, audio, video, tables, pre, iframe, and other media elements. This is automatically included when you import the stylesheet.
|
|
50
|
+
|
|
39
51
|
## License
|
|
40
52
|
|
|
41
53
|
MIT
|
package/dist/atomic-bricks.css
CHANGED
|
@@ -4,7 +4,39 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/* Prevent horizontal overflow and scrolling, modern way */
|
|
7
|
+
|
|
7
8
|
html, body {
|
|
8
9
|
overflow-x: clip;
|
|
9
10
|
}
|
|
10
11
|
|
|
12
|
+
/* Breakout CSS - Framework-agnostic utilities for breaking out images and figures */
|
|
13
|
+
|
|
14
|
+
.breakout {
|
|
15
|
+
padding-left: 10%;
|
|
16
|
+
padding-right: 10%;
|
|
17
|
+
|
|
18
|
+
/* Direct children, or wrapped in <p> for Markdown support */
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.breakout > img:not(does-not-exist):not(.does-not-exist),.breakout > picture:not(does-not-exist):not(.does-not-exist),.breakout > figure:not(does-not-exist):not(.does-not-exist),.breakout > canvas:not(does-not-exist):not(.does-not-exist),.breakout > audio:not(does-not-exist):not(.does-not-exist),.breakout > table:not(does-not-exist):not(.does-not-exist),.breakout > pre:not(does-not-exist):not(.does-not-exist),.breakout > iframe:not(does-not-exist):not(.does-not-exist),.breakout > object:not(does-not-exist):not(.does-not-exist),.breakout > embed:not(does-not-exist):not(.does-not-exist),.breakout > video:not(does-not-exist):not(.does-not-exist),.breakout > .breakout-item:not(does-not-exist),.breakout > .breakout-item-max:not(does-not-exist),.breakout > p > img:not(.does-not-exist),.breakout > p > picture:not(.does-not-exist),.breakout > p > figure:not(.does-not-exist),.breakout > p > canvas:not(.does-not-exist),.breakout > p > audio:not(.does-not-exist),.breakout > p > table:not(.does-not-exist),.breakout > p > pre:not(.does-not-exist),.breakout > p > iframe:not(.does-not-exist),.breakout > p > object:not(.does-not-exist),.breakout > p > embed:not(.does-not-exist),.breakout > p > video:not(.does-not-exist),.breakout > p > .breakout-item,.breakout > p > .breakout-item-max {
|
|
22
|
+
display: inline-block;
|
|
23
|
+
width: auto;
|
|
24
|
+
min-width: 100%;
|
|
25
|
+
max-width: 125%;
|
|
26
|
+
transform: translateX(-50%);
|
|
27
|
+
margin-left: 50%;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Let inline blocks shrink to fit their content */
|
|
31
|
+
|
|
32
|
+
.breakout > img:not(does-not-exist),.breakout > picture:not(does-not-exist),.breakout > figure:not(does-not-exist),.breakout > canvas:not(does-not-exist),.breakout > audio:not(does-not-exist),.breakout > p > img,.breakout > p > picture,.breakout > p > figure,.breakout > p > canvas,.breakout > p > audio {
|
|
33
|
+
min-width: auto;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Max out the width of the element */
|
|
37
|
+
|
|
38
|
+
.breakout > .breakout-item-max:not(does-not-exist),.breakout > p > .breakout-item-max {
|
|
39
|
+
width: 125% !important; /* @TODO: !important for cases like figure.breakout-item-max */
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* @TODO: Allow non-direct children. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anydigital/atomic-bricks",
|
|
3
|
-
"version": "1.0.0-alpha",
|
|
3
|
+
"version": "1.0.0-alpha.2",
|
|
4
4
|
"description": "Framework-agnostic CSS utility helpers for modern web development",
|
|
5
5
|
"main": "dist/atomic-bricks.css",
|
|
6
6
|
"style": "dist/atomic-bricks.css",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"src"
|
|
10
10
|
],
|
|
11
11
|
"scripts": {
|
|
12
|
-
"build": "
|
|
12
|
+
"build": "postcss src/atomic-bricks.css --no-map -o dist/atomic-bricks.css",
|
|
13
13
|
"prepublishOnly": "npm run build"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
@@ -26,10 +26,12 @@
|
|
|
26
26
|
"author": "Anton Staroverov",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"devDependencies": {
|
|
29
|
+
"@anydigital/breakout-css": "^1.0.0-alpha.6",
|
|
29
30
|
"postcss": "^8.4.33",
|
|
30
|
-
"postcss-cli": "^11.0.0"
|
|
31
|
+
"postcss-cli": "^11.0.0",
|
|
32
|
+
"postcss-import": "^16.1.1",
|
|
33
|
+
"postcss-preset-env": "^10.6.0"
|
|
31
34
|
},
|
|
32
35
|
"jsdelivr": "dist/atomic-bricks.css",
|
|
33
36
|
"unpkg": "dist/atomic-bricks.css"
|
|
34
37
|
}
|
|
35
|
-
|
package/src/_base.css
ADDED