Skip to content
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

Adds media queries support to SC.View #1440

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

nicolasbadia
Copy link
Member

@nicolasbadia nicolasbadia commented Feb 18, 2018

This PR adds support for a media property which can be defined to views and allows you to define an object where the keys are CSS media queries and the values are a hash of properties to apply.

Example:

    SC.LabelView.extend({
      layout: { left: 20 },
      title: 'Hello World',
      media: {
        '(max-width: 1000px)': { title: 'Hello', layout: { left: 10 } },
        '(max-width: 800px) or (max-height: 500px)': { layout: { left: 5 } }
      }
    })

@nicolasbadia
Copy link
Member Author

Juste updated the implementation to use the same syntaxe as CSS media query. It is now a lot more powerfull.
I believe once it is live, modeAdjust can be deprecated as it adds nothing more...

@nicolasbadia nicolasbadia force-pushed the team/nicolasbadia/media-queries branch from e0a957b to eddd4b8 Compare August 25, 2019 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant