Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/calm-scrolls-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react-brand': patch
---

Fixed the global reset so smooth scrolling is disabled consistently when users prefer reduced motion.
9 changes: 9 additions & 0 deletions .changeset/fresh-images-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@primer/react-brand': minor
---

Removed the global `block` layout applied to `img` and `picture` elements to prevent overriding of default inline behavior.

To minimize regressions, `block` has been applied to image elements at a component level instead.

⚠️ If you previously relied on the `block` styling to images via our `reset.css`, please apply them manually yourself in your application code.
Comment thread
Copilot marked this conversation as resolved.
Outdated
1 change: 1 addition & 0 deletions packages/react/src/Avatar/Avatar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
}

.Avatar__image {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
Expand Down
5 changes: 5 additions & 0 deletions packages/react/src/EyebrowBanner/EyebrowBanner.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
max-height: var(--base-size-44);
}

.EyebrowBanner__leadingVisual img,
.EyebrowBanner__leadingVisual picture {
display: block;
}

.EyebrowBanner__trailingVisual {
display: flex;
}
Expand Down
4 changes: 4 additions & 0 deletions packages/react/src/LogoSuite/LogoSuite.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@
height: var(--base-size-32);
}

.LogoSuite__logobar img {
display: block;
}

.LogoSuite__logobar--variant-muted svg,
.LogoSuite__logobar--variant-muted path {
fill: var(--brand-LogoSuite-color-logo-muted);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
}

.Footer__social-icon {
display: block;
width: 24px;
height: auto;
}
Expand Down
4 changes: 4 additions & 0 deletions packages/react/src/Testimonial/Testimonial.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@
margin-top: var(--base-size-24);
}

.Testimonial-logo-image {
display: block;
}
Comment thread
rezrah marked this conversation as resolved.

.Testimonial--size-large .Testimonial__media {
margin-top: var(--base-size-64);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ declare const styles: {
readonly "Testimonial-caption": string;
readonly "Testimonial-from": string;
readonly "Testimonial-link": string;
readonly "Testimonial-logo-image": string;
readonly "Testimonial-quote": string;
readonly "Testimonial__media": string;
readonly "Testimonial__quoteMark": string;
Expand Down
22 changes: 9 additions & 13 deletions packages/react/src/css/reset.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,19 @@ ol[role='list'] {
list-style: none;
}

/* Set core root defaults */
/* Set core root scrolling behavior */
html,
html:focus-within {
scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
html,
html:focus-within {
scroll-behavior: auto;
}
}

/* Set core body defaults */
body {
min-height: 100vh;
Expand All @@ -53,7 +61,6 @@ a:not([class]) {
img,
picture {
max-width: 100%;
display: block;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main change ☝️

}

/* Inherit fonts for inputs and buttons */
Expand All @@ -63,14 +70,3 @@ textarea,
select {
font: inherit;
}

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
html:focus-within {
scroll-behavior: auto;
}
}

html {
scroll-behavior: smooth;
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
}

.RiverStoryScroll__image {
display: block;
margin-left: auto;
margin-right: auto;
width: auto;
Expand Down
4 changes: 4 additions & 0 deletions packages/react/src/river/river-shared.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
order: 2;
}

.River__visual :is(img, picture) {
display: block;
}

.River__visual--fill-media img,
.River__visual--fill-media picture,
.River__visual--fill-media video {
Expand Down
Loading