Reputation: 799
Building my first angular app. I want to change the size of the logo displayed in the header bar depending on the screen size. In the past with bootstrap I would have used media queries and css, but I'm not sure how to do it with angular. Have read all sorts of things about putting listeners for screen size but how to I access that from a header component? Do I use the scss file for the header component? Just looking for some pointers on what I should be researching for a method to accomplish this in angular.
Thanks!
Upvotes: 0
Views: 733
Reputation:
I know this is huge, daunting, and vague at times, but the first place to start is the Angular Style Guide. Every time I open it (still even though I've done angular since beta), I still learn and/or see things I haven't noticed before.
As far as your question: If you're only using the style in this one place, yes, put it in the component's css file. You could set the size to a percentage and call it a day- it depends on what your end goal is.
The Angular Flex Layout library may also ease some direct styling (depending on how much flex could or could not help you with your end goal).
(Edit 1) You shouldn't need any fancy listeners or anything. Also, media queries will work just fine still!
Upvotes: 2