You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+36-61Lines changed: 36 additions & 61 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,13 +15,10 @@ Current version: **2.4.2**
15
15
*[Basic usage](#basic-usage)
16
16
*[Execute code on window resize](#execute-code-on-window-resize)
17
17
*[Get alias of current breakpoint](#get-alias-of-current-breakpoint)
18
-
*[Taking precautions](#taking-precautions)
18
+
*[Using with Foundation](#using-with-foundation)
19
+
*[Providing your own visibility classes](#providing-your-own-visibility-classes)
19
20
*[How do I include it in my project?](#how-do-i-include-it-in-my-project)
20
21
*[Dependencies](#dependencies)
21
-
* SASS features
22
-
*[Basic usage](#sass-features)
23
-
*[How do I include it in my project?](#sass-instructions)
24
-
*[Dependencies](#sass-dependencies)
25
22
26
23
### Installation
27
24
````
@@ -94,24 +91,48 @@ $(window).resize(
94
91
});
95
92
````
96
93
97
-
#### Taking precautions
94
+
#### Using with Foundation
95
+
96
+
Instead of Bootstrap's aliases `xs`, `sm`, `md` and `lg`, Foundation uses: `small`, `medium`, `large`, and `xlarge`.
98
97
99
-
In certain circumstances, it might be necessary to wait for certain events to happen before executing your scripts.
100
98
````javascript
101
-
// Execute code only when document has been loaded fully
102
-
$(document).ready(function() {
103
-
if( viewport.is('xs') ) {
99
+
(function($, viewport){
100
+
101
+
viewport.use('Foundation');
102
+
103
+
if( viewport.is('small') ) {
104
104
// ...
105
105
}
106
-
});
107
-
// Execute code only when all resouces have loaded
108
-
$(window).load(function() {
109
-
if( viewport.is('xs') ) {
106
+
107
+
})(jQuery, ResponsiveBootstrapToolkit);
108
+
````
109
+
110
+
**Note:**
111
+
Currently, only Foundation 5 visibility classes are supported. If you'd like to support older version of any framework, or provide your own visibility classes, refer to example below.
You don't need to specify a value for each of the breakpoints. One is enough, four is the max. Example below will work just as well:
142
-
143
-
````css
144
-
h1 {
145
-
@includeset(font-size, (xs: 20px, lg: 30px) );
146
-
}
147
-
````
148
-
149
-
Output:
150
-
151
-
````css
152
-
@media (max-width: 767px) {
153
-
h1 {
154
-
font-size: 20px;
155
-
}
156
-
}
157
-
@media (min-width: 1200px) {
158
-
h1 {
159
-
font-size: 30px;
160
-
}
161
-
}
162
-
````
163
-
164
-
165
-
#### SASS Instructions
166
-
Copy contents of `compass/bootstrap-toolkit` directory into your project. File `style.scss` contains lines that need to be in your own style.scss for the mixin to work. You'll need SASS 3.3+.
167
-
168
-
To start working on project's SASS, run in project's root directory.
"description": "Responsive Bootstrap Toolkit provides an easy way of breakpoint detection in JavaScript, detecting changes in currently active breakpoint, as well as executing any breakpoint-specific JavaScript code.",
0 commit comments