Skip to content

Commit 6f9d1af

Browse files
[docs-infra] Style collocation
Style spread on two different files will be hard to keep in sync. Follow-up on #41181 Also simplify the CSS selector for performance.
1 parent b98c0b5 commit 6f9d1af

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

docs/src/modules/components/Ad.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,6 @@ export default function Ad() {
222222
mt: AD_MARGIN_TOP,
223223
mb: AD_MARGIN_BOTTOM,
224224
minHeight: AD_HEIGHT_MOBILE,
225-
'& a[target="_blank"]::after': {
226-
// Remove link arrow for ads
227-
display: 'none',
228-
},
229225
[theme.breakpoints.up('sm')]: {
230226
minHeight: AD_HEIGHT,
231227
},
@@ -242,6 +238,7 @@ export default function Ad() {
242238
data-ga-event-category="ad"
243239
data-ga-event-action="click"
244240
data-ga-event-label={eventLabel}
241+
className="Ad-root"
245242
>
246243
<AdErrorBoundary eventLabel={eventLabel}>{children}</AdErrorBoundary>
247244
</Box>

docs/src/modules/components/MarkdownElement.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -407,10 +407,14 @@ const Root = styled('div')(
407407
opacity: 1,
408408
transform: 'translate(1px, 0)',
409409
},
410-
'& a.remove-link-arrow[target="_blank"]::after': {
410+
'& a.remove-link-arrow::after': {
411411
// Allows to remove link arrows for images
412412
display: 'none',
413413
},
414+
'& .MuiAd-root a::after': {
415+
// Remove link arrow for ads
416+
display: 'none',
417+
},
414418
'& a, & a code': {
415419
// Style taken from the Link component
416420
color: `var(--muidocs-palette-primary-600, ${lightTheme.palette.primary[600]})`,

0 commit comments

Comments
 (0)