components/flag-icon-css
A curated collection of all country flags in SVG with ready-to-use CSS and SASS for easy integration. Install via npm or Yarn, import the stylesheet, then add fi and fi-xx classes to an empty span; add fis for square flags. Includes CDN support and SASS options for custom paths and country subsets.
users table’s country_code field).fi fi-xx). Architectural fit is unchanged; the release is a "pull-and-verify" upgrade rather than a capability change.fi-fi-xx) based on backend data. Laravel’s Blade directives or JavaScript helpers (e.g., Alpine.js, Livewire) can bridge this gap.@import, Mix purgeCSS). Note svgo was bumped (3.3.2 → 3.3.3), so re-bundling may produce marginally different minified SVG output — expect identical visuals, but byte-level diffs in compiled assets.$flag-icons-included-countries (as prescribed in Phase 3 below), this release is a functional fix — earlier versions may have silently failed to exclude countries or failed the build. This is the single most upgrade-relevant item for our Laravel footprint.User::country) to ISO codes. Risk of mismatched country codes if not standardized.npm remains recommended for production.dependabot batch (lodash, qs, picomatch, immutable, follow-redirects, source-map-js, prettier, sass, svgo) landed. These are build-time/dev-scope for a CSS-only package, so runtime exposure is nil — but lockfile churn and SCSS compile output drift are the practical risks. Expect a non-trivial package-lock.json diff even though the shipped CSS surface is essentially unchanged.US vs. United States)? Is there a mapping layer (e.g., a Country model or helper) to normalize ISO codes?$flag-icons-included-countries to trim the bundle? If yes, validate the exclusion list actually works on v7.6.0 — this is exactly the path that PR #1461 fixed, and it may explain a previously inflated CSS bundle.package-lock.json, and is npm audit gating the build?<span class="fi fi-{{ $user->country_code }}"></span>); Alpine.js/Livewire for dynamic updates; SASS customization via Laravel Mix/Vite.countries table.npm install flag-icons@^7.6.0 and bundle with Vite/Mix; CDN for development only.^7.6.0 (or exact 7.6.0 if we run strict visual baselines). Teams currently on 7.5.x should treat this as a low-risk, drop-in upgrade.app.blade.php, verify with a hardcoded <span class="fi fi-us"></span>."fi fi-{$isoCode}" and use it in Blade.// resources/sass/app.scss
@use "node_modules/flag-icons/sass/flag-icons" with (
$flag-icons-included-countries: ("us", "gb", "de")
);
Add a CI assertion on the compiled CSS size (or a grep for an excluded flag selector) to catch silent exclusion failures — the exact class of bug fixed in #1461.package-lock.json; run npm audit.fi fi-xx class contract is untouched (it is — no breaking change).| Step | Task | Dependencies | Owner |
|---|---|---|---|
| 1 | Bump flag-icons to ^7.6.0; review lockfile diff + npm audit |
None | Frontend |
| 2 | Rebuild assets (Vite/Mix); compare CSS bundle size to prior build | Step 1 | Frontend |
| 3 | Validate SASS $flag-icons-included-countries exclusion actually applies |
Step 1 | Frontend |
| 4 | Visual spot-check of PA, VU, BF, NC, CI, YE, ET, AC + Chrome render | Step 2 | QA |
| 5 | Standardize country codes in DB | Backend model | Backend |
| 6 | Create helper/accessor for flag classes | Step 5 | Backend |
| 7 | Test static flags in Blade | Steps 2, 6 | QA |
| 8 | Implement lazy-loading for long lists | Step 7 | Frontend |
| 9 | Add dynamic updates (Alpine/Livewire), if needed | Step 7 | Frontend |
Steps 1–4 are the new gate introduced by this release and can run in parallel with the pre-existing backend work (5–6).
npm update flag-icons..fi class overrides; the Chrome bleed fix may shift pixel-level rendering by a hairline.How can I help you explore Laravel packages today?