My main focus is JavaScript specialising in frontend UI with React. I like to explore different frameworks and technologies in my spare time. Learning languages (programming and real life) is a blast.
Location
London
Education
Bachelor of Design Innovation in Media Design, Victoria University of Wellington
Namespacing and specificity are certainly challenges which need to be addressed in some way. I think there are certain rules that should be followed in larger teams to avoid these issues like BEM, avoid using !important etc. The specific issue of scope and encapsulation being present in other languages doesn't make it impossible to abuse in those languages, as programmers we just follow rules like keeping functions small and avoiding making too much public.
I haven't encountered many issues with layers though I understand the frustration. Complex layering is not intuitive with CSS and perhaps it's something that needs to be addressed. In modern CSS, I will often favour CSS grids to overlap layers effectively. I also follow a simple rule, HTML is rendered top to bottom and any 'layers' will be rendered back to front. The z-index is something to be used sparingly as there is often a way to achieve the same effect another way.
Although there is no 'breakpoint' like functionality in CSS, I think browsers have done an excellent job of providing great tools for debugging. It's improved significantly in the past decade.
Using the developer console in any modern desktop browser will show which rules are contributing to the final output and where they are coming from. (This screenshot was taken on Firefox inspecting dev.to)
You make some solid points as to why CSS isn't the easiest to reason about. What are some systems of design you find more comfortable to work with out side of the context of web development?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks Brian, you make some great arguments.
Namespacing and specificity are certainly challenges which need to be addressed in some way. I think there are certain rules that should be followed in larger teams to avoid these issues like BEM, avoid using
!important
etc. The specific issue of scope and encapsulation being present in other languages doesn't make it impossible to abuse in those languages, as programmers we just follow rules like keeping functions small and avoiding making too much public.I haven't encountered many issues with layers though I understand the frustration. Complex layering is not intuitive with CSS and perhaps it's something that needs to be addressed. In modern CSS, I will often favour CSS grids to overlap layers effectively. I also follow a simple rule, HTML is rendered top to bottom and any 'layers' will be rendered back to front. The
z-index
is something to be used sparingly as there is often a way to achieve the same effect another way.Although there is no 'breakpoint' like functionality in CSS, I think browsers have done an excellent job of providing great tools for debugging. It's improved significantly in the past decade.
Using the developer console in any modern desktop browser will show which rules are contributing to the final output and where they are coming from. (This screenshot was taken on Firefox inspecting dev.to)
You make some solid points as to why CSS isn't the easiest to reason about. What are some systems of design you find more comfortable to work with out side of the context of web development?