Skip to content

Commit

Permalink
Merge pull request #1027 from SwedbankPay/feature/SWED-2543-add_css_s…
Browse files Browse the repository at this point in the history
…upport

SWED-2543 increase css browserslist support
  • Loading branch information
goldenraphti authored Dec 13, 2024
2 parents 434fea6 + 9029748 commit c362b55
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
2 changes: 2 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@

## Technical changes

- Browser support got significantly increased (now last 2 major versions, Firefox ESR, > 0,5% instead of 1%).
- This is only impacting projects consuming the CSS & JS straight from the CDN. If you're pulling the source files then the polyfilling/transpilling will only be done by your own build pipeline anyways.
- updated dependencies
15 changes: 8 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
"homepage": "https://github.com/swedbankpay/design.swedbankpay.com#readme",
"browserslist": [
"last 3 versions",
"> 1%",
"last 2 major versions",
"> 0.5%",
"Firefox ESR",
"not dead"
],
"dependencies": {
Expand Down
10 changes: 9 additions & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
const postcssPresetEnv = require("postcss-preset-env");

module.exports = {
plugins: [["postcss-preset-env"]],
plugins: [
postcssPresetEnv({
stage: 2,
minimumVendorImplementations: 2,
preserve: true,
}),
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ exports[`GetStarted: ForDevelopers Installation renders 1`] = `
<b>
Target Browser:
</b>
"Last 3 versions, &gt; 1%, not dead"
"Last 3 versions, Last 2 major versions, &gt; 0.5%, not dead"
</p>
</div>
<h4>
Expand All @@ -1180,6 +1180,9 @@ exports[`GetStarted: ForDevelopers Installation renders 1`] = `
It is up to every Project manager and development team to decide which browsers their product should support. If you want to support other browsers than the ones supported by the Design Guide you need to maintain and test the component code in in your project.
</p>
<p>
We of course encourage to use PostCSS to do that in your build pipeline.
</p>
</section>
</section>
`;
6 changes: 5 additions & 1 deletion src/App/GetStarted/get-started/ForDevelopers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ const BrowserSupport = () => (
<div className="alert alert-informative mt-4">
<i className="at-info-circle" aria-hidden="true"></i>
<p>
<b>Target Browser:</b> &quot;Last 3 versions, &gt; 1%, not dead&quot;
<b>Target Browser:</b> &quot;Last 3 versions, Last 2 major versions,
&gt; 0.5%, not dead&quot;
</p>
</div>
<h4>Browser support for products using the Design Guide</h4>
Expand All @@ -360,6 +361,9 @@ const BrowserSupport = () => (
browsers than the ones supported by the Design Guide you need to maintain
and test the component code in in your project.{" "}
</p>
<p>
We of course encourage to use PostCSS to do that in your build pipeline.
</p>
</section>
);
const GridAndBreakpoints = () => (
Expand Down

0 comments on commit c362b55

Please sign in to comment.