@ulu/frontend 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -25,20 +25,18 @@ export class CssBreakpoints {
|
|
|
25
25
|
valueFromPsuedo: false,
|
|
26
26
|
customProperty: "--breakpoint",
|
|
27
27
|
psuedoSelector: ':before',
|
|
28
|
+
order: ["small", "medium", "large"],
|
|
28
29
|
debug: false
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
32
|
* @param {Object} config Configruation object
|
|
32
|
-
* @param {Array} config.order
|
|
33
|
+
* @param {Array} config.order Array of strings that correspond to the breakpoints setup in the styles, Breakpoints from smallest to largest, defaults to [small, medium, large]
|
|
33
34
|
* @param {Array} config.customProperty Property to grab breakpoint from (default is --breakpoint)
|
|
34
35
|
* @param {Array} config.valueFromPsuedo Use the legacy method of grabbing breakpoint from psuedo element, default uses custom property
|
|
35
36
|
* @param {Node} config.element The element to retrieve active breakpoint from stylesheet. (default is html) For using the old psuedo method, adjust this to document.body
|
|
36
37
|
* @param {String} config.psuedoSelector Change psuedo selector used to get the breakpoint from the psuedo's content property
|
|
37
38
|
*/
|
|
38
39
|
constructor(config) {
|
|
39
|
-
if (!config.order) {
|
|
40
|
-
logError(this, 'Missing order (required)!');
|
|
41
|
-
}
|
|
42
40
|
Object.assign(this, CssBreakpoints.defaults, config);
|
|
43
41
|
this.active = null;
|
|
44
42
|
this.previous = null;
|
|
@@ -119,6 +117,7 @@ export class CssBreakpoints {
|
|
|
119
117
|
/**
|
|
120
118
|
* Get a breakpoint by key
|
|
121
119
|
* @param {String} name The name of the breakpoint to get
|
|
120
|
+
* @return {Breakpoint} Breakpoint to act on (see BreakpointDirection)
|
|
122
121
|
*/
|
|
123
122
|
at(name) {
|
|
124
123
|
const bp = this.breakpoints[name];
|