Badges > HAML > Migrate to GlBadge abstraction
There are instances of badges in HAML files that do not use Pajamas-compliant styling, or do not use a suitable abstraction. These need to be ported/made compliant.
## Migration strategy
Replace ad hoc badge tags with `gl_badge_tag`:
```diff
-%span.badge.badge-warning
- = _('pending deletion')
+= gl_badge_tag _('pending deletion'), variant: :warning
```
Some may include other classes, like `badge-danger`, or `sm`/`md`/`lg`. These can be ported to `gl_badge_tag` options fairly directly, for instance:
```diff
-%span.badge.badge-danger.lg
- = _('danger')
+= gl_badge_tag _('danger'), variant: :danger, size: :lg
```
Not all classes correspond like this; for instance, the `badge-primary` class is probably best replaced by the `variant: :info` option. For other options, see the [documentation for the helper](https://gitlab.com/gitlab-org/gitlab/-/blob/21819ee99559e27066c2744b5b15214b17ab99af/app/helpers/badges_helper.rb#L27-58). For comparison, take a look at the available [variants in Pajamas](https://design.gitlab.com/components/badge), or [GitLab UI's Storybook](https://gitlab-org.gitlab.io/gitlab-ui/?path=/story/base-badge--default).
If in doubt about which style is most appropriate, please `@mention` a [Foundations team member](https://about.gitlab.com/company/team/?department=ecosystem-foundations-team) for guidance.
### Badges which deviate from Pajamas styling
Some cases have badges which deviate from our Pajamas styling. In these cases, use your judgement about what the best Pajamas-compliant style would be, ***and*** `@mention` a [Foundations team member](https://about.gitlab.com/company/team/?department=ecosystem-foundations-team) for confirmation/guidance.
epic