Skip to content

Commit

Permalink
Fix stretch in latest Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Sep 2, 2021
1 parent d56b44d commit 089ac2f
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
10 changes: 9 additions & 1 deletion data/prefixes.js
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,15 @@ f(prefixIntrinsic, browsers =>
)

f(prefixIntrinsic, { match: /x|\s#4/ }, browsers =>
prefix(['fill', 'fill-available', 'stretch'], {
prefix(['fill', 'fill-available'], {
props: sizeProps,
feature: 'intrinsic-width',
browsers
})
)

f(prefixIntrinsic, { match: /x|\s#5/ }, browsers =>
prefix(['stretch'], {
props: sizeProps,
feature: 'intrinsic-width',
browsers
Expand Down
10 changes: 10 additions & 0 deletions test/autoprefixer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1047,4 +1047,14 @@ describe('hacks', () => {
expect(result.css).toEqual(input)
expect(result.warnings()).toHaveLength(0)
})

it('supports latest Firefox stretch', () => {
let input = read('intrinsic')
let output = read('intrinsic.ff')
let result = postcss([
autoprefixer({ overrideBrowserslist: 'firefox 90' })
]).process(input)
expect(result.css).toEqual(output)
expect(result.warnings()).toHaveLength(2)
})
})
47 changes: 47 additions & 0 deletions test/cases/intrinsic.ff.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
a {
width: -moz-available;
width: stretch;
}

b {
height: max-content;
}

p {
block-size: min-content;
min-inline-size: -moz-fit-content;
min-inline-size: fit-content;
}

.outdated {
width: fill;
}

.old {
width: fill-available;
}

.ok {
width: calc(100% - var(--jqx-circular-progress-bar-fill-size));
}

.grid {
grid: min-content max-content / fit-content(500px);
}

.grid-template {
grid-template: min-content / fit-content(10px) max-content;
grid-template: max-content 1fr max-content max-content / max-content 1fr;
}

.grid-template-columns {
grid-template-columns: minmax(100px, min-content);
}

.grid-auto-columns {
grid-auto-columns: min-content max-content;
}

.ignore {
width: -webkit-fill-available;
}

0 comments on commit 089ac2f

Please sign in to comment.