@pikapikamart
Posted
Good work on that one, regarding your questions.
-
Well it depends right, when you start first in mobile or mobile first, it would be great idea to use
min-width
on your break points since it will only scale up. But if you start with desktop view,max-width
is the best choice since it will only scale down. I don't usually usemin-height
and in media breakpoints. Also when some styling overlaps another, make sure that you properly declared your styling in their respective media breakpoints. If you specified any styling outside of it, then it is declared globally and will be inherited by all. Unlike when you set styling in the breakpoints, they will only be run when your dimension is reached. -
The reason for that is css specificity. Okay well you declare a font-size to the body right and hoping that it will change the other as well, but, there is a point where you declared in your selector
.faq-section.show .answer
, this selector the font size. Now what happens is that, when you declare in your body tag, the.answer
will not change since it have a higher specificity than the body tag. Because as you can seebody
compared to.faq-section.show .answer
, the latter is more specified right and specificity always win. Reading about specificity will be a great idea^ -
I think it would be better if you just make it display of block and not flex with a column direction. Because if you set it to block, if the answer appears, it will only change the height or add a height to the bottom and will not make the container shake, since when you display it to flex with column direction, the elements is justified to the center right, so it scales dynamically. So when a question appears, it then adds to the height then the parent will dynamically rearranges it so that they will be centered, therefore makes a shake. I suggest making it block, since block container usually places everything in row, unless a child is inline.
Well hoping that would clear some questions^^
@MoranGuy
Posted
@pikamart Thanks a lot, I will try that!
@pikapikamart
Posted
@MoranGuy Your welcome on that^
@pikamart great feedback (as usual)
As a follow on from that, @moranguy I recommend you read up on css specificity. It's best to keep specificity as low as possible so you have good control of your css. To do that, use single class selectors like .my-class
not nested selectors like .outer-parent .inner-parent .my-class
The only times I nest in scss is when
- I'm nesting a media query
- I'm nesting a pseudo element or pseudo state (like :before or :hover)
It makes results much more predictable
@pikapikamart
Posted
@grace-snow Thank you for that^