Flexgrid Angular - Why exactly does the css import need to be in styles.css?

Posted by: andrewalisa on 28 April 2021, 7:22 am EST

  • Posted 28 April 2021, 7:22 am EST

    Hello, I am using the Flexgrid product on Angular 10.

    I am curious so I can understand how Flexgrid works under the hood. Why do you need to add @import '@grapecity/wijmo.styles/wijmo.css'; to styles.css? Why can't I add it at the individual component level, or even one level lower than styles.css?
  • Marked as Answer

    Replied 28 April 2021, 8:17 pm EST


    Wijmo.css is the common style file for all the wijmo controls. You may add it to any component or any level as would like as long as the styles are loaded before wijmo component is created. If you are using the wijmo controls in only one component then you may import it in that component only and it will work without any issues, but if wijmo components are used in multiple places then it makes more sense to import in the styles.css as the common CSS module which will be available for all the components.
    Further importing the CSS file in styles.css files makes sure that wijmo CSS is added before your custom CSS in styles.css so that if you write some custom styles then it overrides the default wijmo styles.
    Hope this clears. Please let us know if you have any doubts.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels