File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 11/**
2- * Determines which breakpoint is currently active.
2+ * Determines which breakpoint is currently active, either by querying for a psuedo element on the body
3+ * or by injecting an element with display classes.
34 *
45 * @returns {jQuery }
56 */
67jQuery . fn . extend ( {
78 isBreakpoint : function ( points ) {
9+ var query = window . getComputedStyle ( document . querySelector ( 'body' ) , ':before' ) . getPropertyValue ( 'content' ) || null ;
10+ if ( ! points . constructor === Array ) { points = [ points ] ; }
11+ if ( null !== query ) { return ( points . indexOf ( query ) !== - 1 ) ; }
812 var test = false ;
913 var $body = $ ( 'body' ) ;
1014 var cls = ' d-none d-sm-none d-md-none d-lg-none d-xl-none' ;
11- if ( ! points . constructor === Array ) { points = [ points ] ; }
1215 $ . each ( points , function ( index , alias ) {
1316 if ( ! $body . find ( '.detect-' + alias ) . length ) {
1417 var tCls = 'detect-' + alias + cls ;
Original file line number Diff line number Diff line change 77 .d-#{$criteria } -table-cell { display : table-cell !important ; }
88 .d-#{$criteria } -flex { display : flex !important ; }
99 .d-#{$criteria } -inline-flex { display : inline-flex !important ; }
10+ }
11+
12+ @mixin display-responsive ($breakpoint ) {
13+ body ::before { content : " #{$breakpoint } " ; display : none !important ; }
14+ @include display ($breakpoint );
1015}
Original file line number Diff line number Diff line change 33
44@if not ($enable-framework ) {
55/* !
6- * Strapless Display v1.0.2 (http://github.com/strapless/display)
6+ * Strapless Display v1.0.3 (http://github.com/strapless/display)
77 * Influenced by Bootstrap v4.0 (http://getbootstrap.com)
88 * Licensed under MIT (https://github.com/strapless/display/blob/master/LICENSE)
99 */
6464@if $enable-framework == false {
6565 @each $bp , $min in $grid-breakpoints {
6666 @if $min == 0 {
67- @include display ($bp )
67+ @include display-responsive ($bp );
6868 } @else {
6969 @media screen and (min-width : $min ) {
70- @include display ($bp );
70+ @include display-responsive ($bp );
7171 }
7272 }
7373 }
You can’t perform that action at this time.
0 commit comments