Last active
December 16, 2015 06:48
-
-
Save stowball/5393732 to your computer and use it in GitHub Desktop.
Pondering how the best way to selectivity include CSS and related JS
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
| /* | |
| If a user chooses to not include the partial for modal styles, | |
| how can we automatically not include the modal function and its init? | |
| Ideally, carousel and modal would be in their own file. It's like we need Sass for JS | |
| */ | |
| (function() { | |
| carousel.init(); | |
| modal.init(); | |
| var carousel = { | |
| init: function() { | |
| // setup carousels | |
| } | |
| }; | |
| var modal = { | |
| init: function() { | |
| // setup modals | |
| } | |
| }; | |
| })(); |
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
| (function() { | |
| // include carousel.init | |
| // include modal.init | |
| //include carousel.js | |
| //include modal.js | |
| })(); |
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
| @include "partials/carousel" | |
| @include "partials/modal" | |
| // A user can easily choose to exclude these modules if they don't want them in the CSS |
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
| var carousel = { | |
| init: function() { | |
| // setup carousels | |
| // could be 1000 lines long | |
| } | |
| }; |
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
| /* Here are my styles for carousels */ |
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
| var modal = { | |
| init: function() { | |
| // setup modals | |
| // could be 1000 lines long | |
| } | |
| }; |
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
| /* Here are my styles for modal dialogs */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment