File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Tests/IgniteTesting/Elements Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,12 @@ private extension HTML {
155155 }
156156
157157 if let maxWidth {
158+ if width == nil {
159+ // If no width has been explicitly set, allow content
160+ // to scale with screen sizes smaller than the max width
161+ // as a sensible default
162+ dimensions. append ( . init( . width, value: " 100% " ) )
163+ }
158164 dimensions. append ( . init( . maxWidth, value: maxWidth. stringValue) )
159165 }
160166
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ class CardTests: IgniteTestSuite {
7272 let output = element. render ( )
7373
7474 #expect( output == """
75- <div class= " card " style= " max-width: 500px " > \
75+ <div class= " card " style= " width: 100%; max-width: 500px" > \
7676 <img src= " /images/photos/dishwasher.jpg " alt= " " class= " card-img-top " /><div class= " card-body " > \
7777 <p class= " card-text " >Before putting your dishes into the dishwasher, give them a quick pre-clean.</p> \
7878 <a href= " / " class= " card-link btn btn-primary " >Back to the homepage</a></div></div>
You can’t perform that action at this time.
0 commit comments