-
Notifications
You must be signed in to change notification settings - Fork 592
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
Enable by default, other tweaks #4741
Conversation
boutell
commented
Oct 2, 2024
- enable by default
- adjust the breakpoints to give them a basis in popular device sizes
- change the option name and translation key names (we can do the rest later) to match the way we talk about the feature elsewhere before it is too late to harmonize them
…ular device sizes, change the option name and translation names (we can do the rest later) to match the way we talk about the feature elsewhere
@@ -89,6 +89,7 @@ module.exports = { | |||
|
|||
async init(self) { | |||
|
|||
self.options.devicePreviewMode = self.options.breakpointPreviewMode || self.options.devicePreviewMode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is temporary until the rest of the logic can be changed over, I didn't want to cowboy that and risk bugs, the idea is to document breakpointPreviewMode
and change the rest of the code when we have time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm doing the changes, releasing with the two names will only make our life harder.
enable: false, | ||
breakpointPreviewMode: { | ||
// Enable breakpoint preview mode | ||
enable: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please tell me if we're missing something, e.g. we think this feature is highly likely to break somebody's build completely if we default it to true. Otherwise we really want people to have this experience out of the box
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do some css transformations on css declarations inside media queries.
If you have
@media (max-width: 700px) {
main {
width: 100%;
}
}
you will end up with
@media (max-width: 700px) {
:where(:not(body[data-breakpoint-preview-mode])) main {
width: 100%;
}
}
@container (max-width: 700px) {
main {
width: 100%;
}
}
:where
is widely supported https://developer.mozilla.org/en-US/docs/Web/CSS/:where
I should be safe to use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that was the main driver for setting enabled: false
by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM