-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Devices won't scale for responsive #7
Comments
Hey yeah, I was just trying that. Transform is a mess here. I think the correct approach would be re-doing all the units. Easiest would be to use The same idea would have be done with |
i think one option is, rewrite in the html the css .device{ transform: scale(1); } in every mediaquery, with this the device resize fast and the content resize to, to align the dervice i create a div with other class over, simple put the div alignment (sorry for my english) |
Found this responsive one for iphone x: https://codepen.io/dani3lsz/pen/MEZjeo Ideally all of them should be responsive :( |
+1, |
css zoom seems to be a quick and easy temporary fix. |
css zoom will only work in Chrome. For cross-browser, you need to use |
Ran into this issue myself and this works pretty well if you just need responsive sizes:
|
Currently I forked the source css file from package .device {
--devices-scale: 1;
}
.device-iphone-14-pro .device-frame {
background: #010101;
border: calc(var(--devices-scale)*1px) solid #1b1721;
border-radius: calc(var(--devices-scale)*68px);
box-shadow: inset 0 0 calc(var(--devices-scale)*4px) calc(var(--devices-scale)*2px) #c0b7cd, inset 0 0 0 calc(var(--devices-scale)*6px) #342c3f;
height: calc(var(--devices-scale)*868px);
padding: calc(var(--devices-scale)*19px);
width: calc(var(--devices-scale)*428px);
} In this way, |
Thanks @JiangWeixian , I do not know using that much of .device {
position: relative;
transform: scale(1);
z-index: 1;
}
.device-lg {
--devices-scale: 1;
}
.device-md {
--devices-scale: 0.6;
}
.device-sm {
--devices-scale: 0.4;
}
.device-xs {
--devices-scale: 0.2;
} |
I've spent a bunch of time trying to get these devices to scale when displayed on a mobile screen and can't seem to get them to work correctly. Using something like transform shrinks the device but also screws up any alignment and puts it off the page.
The text was updated successfully, but these errors were encountered: