forked from ibm-js/deliteful
-
Notifications
You must be signed in to change notification settings - Fork 0
/
channelBreakpoints.js
59 lines (56 loc) · 1.78 KB
/
channelBreakpoints.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/** @module deliteful/channelBreakpoints */
define(["module"],
function (module) {
var config = module.config();
/**
* This module returns an object containing properties that define values for breakpoints
* of CSS media queries based on screen size:
*
* - `smallScreen`: defines the screen size limit between phone-like and tablet-like
* channels.
* - `mediumScreen`: defines the screen size limit between tablet-like and desktop-like
* channels.
*
* The values of the breakpoints are used by CSS media queries of `deliteful/features`
* for setting the `has()`-flags `"phone-like-channel"`, `"tablet-like-channel"`, and
* `"desktop-like-channel"`.
*
* The default values of the breakpoints can be configured using `require.config()`,
* for instance:
*
* ```html
* <script>
* // configuring RequireJS
* require.config({
* ...
* config: {
* "deliteful/channelBreakpoints": {
* smallScreen: "280px",
* mediumScreen: "724px"
* }
* }
* });
* </script>
* ```
*
* @module deliteful/channelBreakpoints
*/
return /** @lends module:deliteful/channelBreakpoints# */ {
/**
* The maximum screen size value for small screens.
* Used as breakpoint by a CSS media query of `deliteful/features` as screen size
* threshold between the phone-like and the tablet-like channels.
* @member {string}
* @default "480px"
*/
smallScreen: config.smallScreen || "480px",
/**
* The maximum screen size value for medium screens.
* Used as breakpoint by a CSS media query of `deliteful/features` as screen size
* threshold between the tablet-like and the desktop-like channels.
* @member {string}
* @default "1024px"
*/
mediumScreen: config.mediumScreen || "1024px"
};
});