@@ -12,6 +12,43 @@ revision: 1
1212- one or more gradient fill above solid fill
1313- one or more image fill
1414
15+ ## Related CSS Properties & Functions
16+
17+ ** [ color] ( https://developer.mozilla.org/en-US/docs/Web/CSS/color_value ) & [ gradient] ( https://developer.mozilla.org/en-US/docs/Web/CSS/gradient ) **
18+
19+ - [ background-color] ( https://developer.mozilla.org/en-US/docs/Web/CSS/background-color )
20+ - [ background] ( https://developer.mozilla.org/en-US/docs/Web/CSS/background )
21+ - [ linear-gradient] ( https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient )
22+ - [ radial-gradient] ( https://developer.mozilla.org/en-US/docs/Web/CSS/radial-gradient )
23+ - [ repeating-linear-gradient] ( https://developer.mozilla.org/en-US/docs/Web/CSS/repeating-linear-gradient )
24+ - [ repeating-radial-gradient] ( https://developer.mozilla.org/en-US/docs/Web/CSS/repeating-radial-gradient )
25+ - [ conic-gradient] ( https://developer.mozilla.org/en-US/docs/Web/CSS/conic-gradient )
26+ - [ repeating-conic-gradient] ( https://developer.mozilla.org/en-US/docs/Web/CSS/repeating-conic-gradient )
27+ - [ url] ( https://developer.mozilla.org/en-US/docs/Web/CSS/url )
28+ - element() (not supported yet)
29+ - [ image] ( https://developer.mozilla.org/en-US/docs/Web/CSS/image/image )
30+
31+ ** [ image] ( https://developer.mozilla.org/en-US/docs/Web/CSS/image ) **
32+
33+ - [ background-image] ( https://developer.mozilla.org/en-US/docs/Web/CSS/background-image )
34+ - [ background] ( https://developer.mozilla.org/en-US/docs/Web/CSS/background )
35+ - [ background-repeat] ( https://developer.mozilla.org/en-US/docs/Web/CSS/background-repeat )
36+ - [ object-fit] ( https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit )
37+ - [ object-position] ( https://developer.mozilla.org/en-US/docs/Web/CSS/object-position )
38+ - [ background-size] ( https://developer.mozilla.org/en-US/docs/Web/CSS/background-size )
39+ - [ background-clip] ( https://developer.mozilla.org/en-US/docs/Web/CSS/background-clip )
40+ - [ background-origin] ( https://developer.mozilla.org/en-US/docs/Web/CSS/background-origin )
41+
42+ ## Design considerations
43+
44+ What we've considered while building multiple background support for css
45+
46+ - Multiple mixed types - ` <color> ` , ` <gradient> ` , and ` <image> ` - How should we handle them?
47+ - Multiple types with inconsistent transforms - ` object-fit ` , ` object-position ` , ` background-size ` , ` background-clip ` , ` background-origin `
48+ - When to use baked image and when not to.
49+ - If there are multiple background values with mixed types and inconsistent transforms, it is often better to use baked image for cleaner code, and it's very probable that the box itself works as a artwork
50+ - When to use baked image as ` src ` attribute (` <img src=""> ` ) or ` background ` property
51+
1552## Possible combinations
1653
1754single solid fill
@@ -58,3 +95,45 @@ no solid fill with multiple gradient fill
5895 background : linear-gradient (to bottom , #fff , #fff ), linear-gradient (to bottom , #fff , #fff );
5996}
6097```
98+
99+ multiple images with different transforms
100+
101+ Using array syntax
102+
103+ ``` css
104+ ._1 {
105+ background-image : url (" image1.jpg" ), url (" image2.jpg" );
106+ background-position : right bottom , left top ;
107+ background-size : 50% 50% , auto ;
108+ }
109+ ```
110+
111+ Using pseudo elements - This is useful when there are less than 3 images - main, overlay, background
112+
113+ ``` css
114+ ._1 ::before ,
115+ div ::after {
116+ content : " " ;
117+ position : absolute ;
118+ top : 0 ;
119+ left : 0 ;
120+ width : 100% ;
121+ height : 100% ;
122+ }
123+ ._1 ::before {
124+ background : url (" image1.jpg" ) no-repeat ;
125+ background-size : cover ;
126+ transform : rotate (45deg );
127+ clip-path : circle (50% at 50% 50% );
128+ }
129+
130+ ._1 ::after {
131+ background : url (" image2.jpg" ) no-repeat ;
132+ background-size : cover ;
133+ transform : scale (0.5 );
134+ }
135+ ```
136+
137+ ## Image resources management on SSG frameworks
138+
139+ - Next.js (Docs not ready)
0 commit comments