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

default sass vars + DOMContentLoaded "bugfix" by strajk #17

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Unison",
"version": "0.6.0",
"version": "0.7.0",
"homepage": "http://bjork24.github.io/Unison/",
"authors": [
"Dan Chilton <[email protected]>"
Expand Down
20 changes: 10 additions & 10 deletions css/_breakpoints.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// config
$debug: true;
$debug: true !default;

// declare breakpoints
$usn-x-small : 200px;
$usn-small : 400px;
$usn-small-medium : 600px;
$usn-medium : 800px;
$usn-large-medium : 1000px;
$usn-large : 1200px;
$usn-x-large : 1400px;
$usn-x-small : 200px !default;
$usn-small : 400px !default;
$usn-small-medium : 600px !default;
$usn-medium : 800px !default;
$usn-large-medium : 1000px !default;
$usn-large : 1200px !default;
$usn-x-large : 1400px !default;

// create sass list to pass media query data
// if a breakpoint name changes, remember to
Expand All @@ -21,7 +21,7 @@ $mq-sync:
usn-large-medium $usn-large-medium,
usn-large $usn-large,
usn-x-large $usn-x-large
;
!default;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this `!default~ have to be split across usn-large, usn-large-medium, et al? Or does just putting it here apply it to all?


// build each media query for js ingestion
@each $mq in $mq-sync {
Expand Down Expand Up @@ -63,4 +63,4 @@ body:after {

// hide elements for conditional loading
// only used for responsive comments plugin
*[data-usn-if] { display: none; }
*[data-usn-if] { display: none; }
16 changes: 11 additions & 5 deletions js/unison.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,16 @@ Unison = (function() {
};

win.onresize = util.debounce(breakpoints.update, 100);
doc.addEventListener('DOMContentLoaded', function(){
unisonReady = win.getComputedStyle(head, null).getPropertyValue('clear') !== 'none';
breakpoints.update();
});

if (document.readyState == "complete" || document.readyState == "loaded" || document.readyState == "interactive") {
unisonReady = win.getComputedStyle(head, null).getPropertyValue('clear') !== 'none';
breakpoints.update();
} else {
doc.addEventListener('DOMContentLoaded', function(){
unisonReady = win.getComputedStyle(head, null).getPropertyValue('clear') !== 'none';
breakpoints.update();
});
}

return {
fetch : {
Expand All @@ -99,4 +105,4 @@ Unison = (function() {
}
};

})();
})();
2 changes: 1 addition & 1 deletion js/unison.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.