Commit 61dd8ba6 authored by Oskar Kalbag's avatar Oskar Kalbag

Added support for background-size: cover

parent 81dc7db5
......@@ -142,3 +142,7 @@ h2 {
background-size: 500px 500px;
background-size: 31.25rem 31.25rem;
}
#test-background-size-cover {
background-image: linear-gradient(90deg, transparent 50%, rgba(255,255,255,0.5) 50%);
background-size: cover;
}
......@@ -21,7 +21,7 @@
/* Convert unit to rems if unit is in pixels. */
remify(value)
if value == 'inherit' || value == 'auto' || value == 'none' || value == 0 || value == null
if value == 'inherit' || value == 'auto' || value == 'none' || value == 'cover' || value == 0 || value == null
value
else if unit(value) == 'px'
unit(value/16, 'rem')
......
......@@ -85,8 +85,10 @@
<section>
<h2>Background size</h2>
<div id='test-background-size' data-assert='background-size: 500px 500px'>background-size 500px 500px</div>
<div id='test-background-size-cover' data-assert='background-size: cover'>background-size cover</div>
</section>
<script src='dom-style-test-runner.js'></script>
</body>
</html>
\ No newline at end of file
......@@ -120,6 +120,10 @@ h2
// background-size
#test-background-size
background-image: linear-gradient(90deg, transparent 50%, rgba(255,255,255,.5) 50%);
background-size: 500px 500px;
// background-size 100px
\ No newline at end of file
background-image linear-gradient(90deg, transparent 50%, rgba(255,255,255,.5) 50%)
background-size 500px 500px
// background-size 100px
#test-background-size-cover
background-image linear-gradient(90deg, transparent 50%, rgba(255,255,255,.5) 50%)
background-size cover
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment