1 | export default class Sizes {
|
2 | constructor(inSizes) {
|
3 | this.sizes = inSizes
|
4 | }
|
5 | toString = () => {
|
6 | let output = ``
|
7 | for (let breakpoint in this.sizes) {
|
8 | const width = this.sizes[breakpoint]
|
9 | if (breakpoint !== 'default') {
|
10 | output = `${output}${breakpoint} ${width},\n`
|
11 | } else {
|
12 | output = `${output} ${width}`
|
13 | }
|
14 |
|
15 | }
|
16 | if (Object.keys(this.sizes).includes('default')) {
|
17 | return output
|
18 | } else {
|
19 | return output.slice(0, -2)
|
20 | }
|
21 | }
|
22 | }
|