Hi,
I've got a right side drawer component, which slides into view from right side for specific tasks.
That drawer is using position:fixed to get that slide in out stuff up and running.
The drawer view is limited in width (does not span the whole width of the browser window)
Actually it s similar to the mobile view which I am defining using include media-breakpoint-down(sm) in my sass.
However it does not work for my drawer, mobile styles are not applied.
I know it s a quite specific question, but any hint would be greatly appreciated.
--
volker
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @vhochsteinTef ,
Could you please add more about the question/ask. Also can you add the css you are using?
Is right side drawer a custom component create in AEM?
There might be following reason
1.Re-verify if the target element in css is correctly specified(
@media (max-width: 576px) { // or your defined breakpoint
.drawer {
width: 80%; // Set width appropriate for mobile
right: 0; // Ensure it's positioned off-screen initially
}
}
2. Or cross check if any JS is overiding the css
const toggleDrawer = () => {
const drawer = document.querySelector('.drawer');
drawer.classList.toggle('open'); // This class should have styles for visibility
};
3.Can you try !important to the css property for mobile view
.selector {
property: value !important;
}
Thanks
Views
Replies
Total Likes
Hi @vhochsteinTef ,
It sounds like your media query is not being applied to the right-side drawer, even though it works in other cases. Here are some possible reasons and solutions:
Possible Solutions:
Check if the Media Query is Being Compiled
Increase Selector Specificity
Force Styles Using !important
Test with a Basic CSS Media Query
Ensure the Parent Element Isn’t Clipping the Drawer
Views
Replies
Total Likes
@vhochsteinTef Did you find the suggestions helpful? If you need more information, please let us know. If a response resolved your issue, kindly mark it as correct to help others in the future. Alternatively, if you discovered a solution on your own, we'd appreciate it if you could share it with the community. Thank you !
Views
Replies
Total Likes
Views
Like
Replies
Views
Likes
Replies
Views
Likes
Replies