rgkimball / e3_js

A template for modular javascript in Drupal
0 stars 1 forks source link

Breakpoint config from module #2

Open rgkimball opened 10 years ago

rgkimball commented 10 years ago

Replacing the e3.breakpoints object and any aliases (eg. e3.bpmobile) with a config page within Drupal to allow modifying values and changing variable names instead of hardcoding these in e3_utils.js. This would also allow us to reorder breakpoint values in ascending order, so we always know e3.breakpoints[0] is the smallest breakpoint.

rgkimball commented 10 years ago

Alternatively, use a breakpoints.json file in the theme or module and rewrite _base.scss to parse this so we can keep it out of config and only require updating in one place. This also keeps config-related stuff out of e3.js. Something like this:

{
  "breakpoints": {
    "mobile": "460",
  }
}

Would output a $bp-mobile = 460px variable in Sass and a e3.bpmobile = 460 variable in JS.