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

Add viewport width & height conditions to modules #41

Open
wildhaber opened this issue Sep 19, 2017 · 0 comments
Open

Add viewport width & height conditions to modules #41

wildhaber opened this issue Sep 19, 2017 · 0 comments

Comments

@wildhaber
Copy link
Owner

Description

When developing on a responsive website there are some elements that has to be cloned and used doubled - for example a navigation for the burger-style-menu on mobile and the mega-menu on a large screen.

Instead of loading both at once, what, if it would be possible to load a module only when a certain viewport width/height is valid, like:

import { ModuleSignature } from 'gluebert/module';

const NAVIGATION_MODULE = new ModuleSignature(`menu`, `.c-navigation`, { viewport: width: min: 123, max: 789 }, height: { min: 123, max: 678 }  })
    .setImportController(() => import('./navigation.controller').then((controller) => controller.NavigationController))
    .setImportStyles(() => import('./navigation.styles.scss'));

export {
    NAVIGATION_MODULE,
};
@wildhaber wildhaber added this to the v0.2.0 milestone Sep 19, 2017
@wildhaber wildhaber removed this from the v0.2.0 milestone Mar 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant