Skip to content

Commit b1a8f27

Browse files
authored
Merge pull request #769 from tailwindcss/make-replaced-elements-block
Make replaced elements block by default, preserve aspect ratio
2 parents 426a549 + 0bbf942 commit b1a8f27

File tree

3 files changed

+99
-0
lines changed

3 files changed

+99
-0
lines changed

__tests__/fixtures/tailwind-output-important.css

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,39 @@ samp {
553553
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
554554
}
555555

556+
/**
557+
* Make replaced elements `display: block` by default as that's
558+
* the behavior you want almost all of the time. Inspired by
559+
* CSS Remedy, with `svg` added as well.
560+
*
561+
* https://github.com/mozdevs/cssremedy/issues/14
562+
*/
563+
564+
img,
565+
svg,
566+
video,
567+
canvas,
568+
audio,
569+
iframe,
570+
embed,
571+
object {
572+
display: block;
573+
vertical-align: middle;
574+
}
575+
576+
/**
577+
* Constrain images and videos to the parent width and preserve
578+
* their instrinsic aspect ratio.
579+
*
580+
* https://github.com/mozdevs/cssremedy/issues/14
581+
*/
582+
583+
img,
584+
video {
585+
max-width: 100%;
586+
height: auto;
587+
}
588+
556589
.container {
557590
width: 100%;
558591
}

__tests__/fixtures/tailwind-output.css

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,39 @@ samp {
553553
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
554554
}
555555

556+
/**
557+
* Make replaced elements `display: block` by default as that's
558+
* the behavior you want almost all of the time. Inspired by
559+
* CSS Remedy, with `svg` added as well.
560+
*
561+
* https://github.com/mozdevs/cssremedy/issues/14
562+
*/
563+
564+
img,
565+
svg,
566+
video,
567+
canvas,
568+
audio,
569+
iframe,
570+
embed,
571+
object {
572+
display: block;
573+
vertical-align: middle;
574+
}
575+
576+
/**
577+
* Constrain images and videos to the parent width and preserve
578+
* their instrinsic aspect ratio.
579+
*
580+
* https://github.com/mozdevs/cssremedy/issues/14
581+
*/
582+
583+
img,
584+
video {
585+
max-width: 100%;
586+
height: auto;
587+
}
588+
556589
.container {
557590
width: 100%;
558591
}

src/plugins/css/preflight.css

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,36 @@ kbd,
198198
samp {
199199
font-family: theme('fontFamily.mono', SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
200200
}
201+
202+
/**
203+
* Make replaced elements `display: block` by default as that's
204+
* the behavior you want almost all of the time. Inspired by
205+
* CSS Remedy, with `svg` added as well.
206+
*
207+
* https://github.com/mozdevs/cssremedy/issues/14
208+
*/
209+
210+
img,
211+
svg,
212+
video,
213+
canvas,
214+
audio,
215+
iframe,
216+
embed,
217+
object {
218+
display: block;
219+
vertical-align: middle;
220+
}
221+
222+
/**
223+
* Constrain images and videos to the parent width and preserve
224+
* their instrinsic aspect ratio.
225+
*
226+
* https://github.com/mozdevs/cssremedy/issues/14
227+
*/
228+
229+
img,
230+
video {
231+
max-width: 100%;
232+
height: auto;
233+
}

0 commit comments

Comments
 (0)