Assume that according design the red button must be displayed only on wide screens.
Nothing difficult if just to display it, but I'll skip the decorations.
.Container {
display: flex;
column-gap: 12px;
}
@media screen and (max-width: 340px) {
.Button__WideScreensOnly {
display: none;
}
}
<div class="Container">
<button class="Button">Button</button>
<button class="Button">Button</button>
<button class="Button Button__WideScreensOnly">Narrow screens only</button>
</div>
AFAIK the accessibility software does not respect the CSS thus the third button will be always be visible for the accessibility software. But the user (for example with weak vision but able to push the button if a screen reader will read the button label) can't push it on narrow screens.
The common solution for the marking the hidden elements for the accessibility software is "hidden" attribute (the attribute of the tag, not CSS property). But AFAIK the attributes could not be media query dependent.
