angular-ui-router-styles icon indicating copy to clipboard operation
angular-ui-router-styles copied to clipboard

Enhancements proposal

Open manuelmazzuola opened this issue 9 years ago • 0 comments

  • There is no direct way to disable some named style in the state down the chain
  • Named styles construct is too bulky
  • What if we could advance the idea of named styles further and create a named groups of styles?

Idea to solve these problems as described at https://github.com/manuelmazzuola/angular-ui-router-styles/issues/18#issuecomment-183316049

.state({
  name: 'root',
  abstract: true,
  data: {
    css: {
      layout: [
        // All CSS files of the primary layout are grouped together under the "layout" named group
        'bootstrap.css',
        'primary-layout.css',
        '/vendor/fancybox/jquery.fancybox.css'
      ],
      overall: [
        // The entry of the named group list could be either a string as above
        // or a hash-object with additional options
        {
          href: 'animate.css',
          'some-other-property': 'value',
          'and-another-property': 100500
        }
      ]
    }
  }
})
.state({
  name: 'bar',
  parent: 'root.foo',
  data: {
    css: {
      // Overloading the entire layout by a single CSS file
      layout: 'alternative-layout.css'
    }
  }
})

manuelmazzuola avatar Feb 12 '16 14:02 manuelmazzuola