Skip to content

Commit e2ff14c

Browse files
authored
Fixes MicrosoftDocs#5252 by adding docs on customizing badge style
1 parent b7067bd commit e2ff14c

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

hub/apps/publish/microsoft-store-app-badge.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.localizationpriority: medium
99

1010
# The new Microsoft Store badges are here
1111

12-
We've refreshed the Microsoft Store badge to feature the new logo, with a more refined call-to-action to give users more confidence to acquire your app. These will go live on our [badge creator page](https://apps.microsoft.com/badge) on **August 7, 2024** in all supported languages.
12+
We've refreshed the Microsoft Store badge to feature the new logo, with a more refined call-to-action to give users more confidence to acquire your app. Generate the badge for your app on the [badge creator page](https://apps.microsoft.com/badge).
1313

1414
## How do I get the new badge?
1515

@@ -25,12 +25,25 @@ If you're a developer with an app published on the Microsoft Store, and if you'v
2525
| <img src="../images/new-badge-dark.png" width="256" alt="New Store badge for dark mode"> | <img src="../images/new-badge-light.png" width="256" alt="New Store badge for light mode"> |
2626
| ------------- | ------------- |
2727

28-
2928
If you don't have a badge yet, visit the [Microsoft Store badge creator page](https://apps.microsoft.com/badge) to choose the options that work best for your badge and hit Generate to create one for your app.
3029

30+
## Customizing the badge appearance on your site
31+
The badge is a [web component](https://developer.mozilla.org/en-US/docs/Web/API/Web_components) that automatically detects the user's language and theme and displays the appropriate badge image. As a web component, the badge won't inherit styles from your page.
32+
33+
But you may need to customize the appearance of the badge. For example, you may wish to adjust the size of the badge on your page to match other button sizes. To do this, you can use a [CSS part selector](https://developer.mozilla.org/en-US/docs/Web/CSS/::part) to style the badge:
34+
35+
```css
36+
/* The badge should have a max width of 200px to match other buttons on my page.
37+
The badge image preserves aspect ratio, so changing the max-width will also affect the badge height.
38+
*/
39+
ms-store-badge::part(img) {
40+
max-width: 200px;
41+
}
42+
```
43+
3144
### Some tips to make the most of your badge
32-
* We'll have a different badge color for dark and light modes, and you should pick what works best for your website or allow it to be automatically detected.
33-
* We recommend using the standard JavaScript-based badge, but if your website doesn't use JavaScript, you'll be able to create a non-JS version too.
45+
* The badge will detect light or dark mode automatically based on the user's preference. However, you can optionally override the badge theme on the [badge creator page](https://apps.microsoft.com/badge).
46+
* We recommend using badge web component because it detects the user's theme and language. But if you need to display your app badge on a page that doesn't support JavaScript, such as GitHub markdown pages, you can optionally create a non-JS version of the badge on the [badge creator page](https://apps.microsoft.com/badge).
3447
* Remember to add a campaign ID with a unique string so you can better track your traffic sources on the Microsoft Store Partner Center dashboard.
3548

36-
Please avoid altering the badge – including changing the color, the text, or the elements within.
49+
Please avoid altering the badge color, text, or elements within.

0 commit comments

Comments
 (0)