Implement Responsive Design in devices.css using getCqi Function and inline-size Container Type#22
Open
scheibome wants to merge 6 commits intopicturepan2:masterfrom
Open
Implement Responsive Design in devices.css using getCqi Function and inline-size Container Type#22scheibome wants to merge 6 commits intopicturepan2:masterfrom
scheibome wants to merge 6 commits intopicturepan2:masterfrom
Conversation
added 6 commits
December 29, 2023 00:59
e03c673 to
78a89c4
Compare
Author
|
This would also resolve Issue #7 |
|
Firefox does not support For anyone wondering how to make the devices responsive, you need to place the devices inside of a |
Author
|
Firefox has supported cgi as a length unit, as used in my pull request, for more than a year. https://caniuse.com/mdn-css_types_length_container_query_length_units |
|
My bad, it also seems that the feature flag in question is enabled by default. Is it possible to style devices according to height i.e. in a flex row? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request proposes enhancements to the devices.css for improving its responsiveness across various devices. It introduces the
getCqifunction and leverages the CSScontainer-type: inline-sizeto replace fixed pixel measurements with a dynamic, device-responsive approach.Changes
getCqifunction to the package's CSS utility functions.getCqifunction.container-type: inline-sizeto relevant containers within the package for dynamic adaptation to device widths.Rationale
Fixed pixel values in CSS lead to a non-responsive design that doesn't accommodate the vast array of device screen sizes available today. The adoption of a more responsive design is crucial to ensure usability across all devices.
Responsive Design
The introduction of the
getCqifunction allows dynamic adjustment of sizes based on the device's width. This ensures that layouts and element sizes are flexible and automatically adapt to different screen sizes.Scalability
The use of
calc()with relative units (1cqi) related to the device's width enables proportional scaling of elements. This maintains a consistent user experience across devices.Maintenance and Readability
Defining sizes with the
getCqifunction not only simplifies maintenance but also enhances code readability. It provides a clear understanding of how elements will resize and adjust across different devices.Accessibility
Using relative sizes for elements ensures appropriate scaling on various devices, especially important for users with accessibility needs.
Testing
Conclusion
Integrating these changes into devices.css will significantly enhance its responsiveness, ensuring a better and more consistent user experience across all device types and screen sizes.