Sometimes you don’t want what you inherit…

I have a developed a love-hate relationship with CSS inheritance.  I love what it can do; with a few key strokes you can establish guidelines for the entire website.  That is a beautiful thing.  It saves time initially and limits the length of editing time when you want to change something.   But, I have learned it is a double edged sword.  Those same rules that make life so easy, can come back to make your web designing experience hell.  Inheritance can result in having to become a detective reading and re-reading code to find that one bit that is affecting code you never intended, making your <h3> show up in Arial instead of the great new font found on Google font or making text cover the monitor rather than fitting into the space you just designed.  Then the chase begins, time to run down random code.

I felt that I was really on top of this concept after completely re-working my Nav Studies assignment.  That was a serious lesson in inheritance.  I had not a concern in the world going into the web page assignment.  Until everything fell apart about half way through and inheritance issues swamped me.  I ripped it to shreds and started over.  I added things back in one bit at a time trying to stay on top of the inheritance issues.  That was the point when I realized that I didn’t have full control of the issue yet and it drove me to the internet in search of wiser heads.

Seriously, where was this before I started?  (http://eddieli.org/2013/01/27/inheritance-and-cascading-styles-in-css-explained/)   He even says it in the title:  inheritance explained.   Actually, there is no shortage of people ready to explain inheritance, like this blog http://www.liferay.com/web/nathan.cavanaugh/blog/-/blogs/css-inheritance.

I’ll be honest, I get the idea of inheritance.  It’s a logical progression and I like that.  Start at point A and progress to all points thereafter.  It’s just that there is a point where I am cross-eyed from reading my code and everything has been seen so many times that familiarity has made it seem correct.  That is the frustration point for me.  The past two weeks it has not helped to be in a dental crisis resulting in lots of antibiotics and pain pills (starting week 3 out with slight improvements).  A clouded head doesn’t do much for figuring out your code crisis.

So, when I am tired, what is my salvation.  Is it perhaps a CSS preprocessor?   I honestly don’t know anything about preprocessors.  There was an article to read, but that was at the beginning of the class and it went right over my head.  So, I try to check it out with some blogs.  Over in the UK, I get a glimpse into LESS and SASS from http://www.stuffandnonsense.co.uk/blog/about/less.  The preference there is LESS.  He found SASS confusing to set up, which doesn’t intimidate me since I feel like I am good at software.  The big thing in this blog is that he gives a good view of what a preprocessor does and why people who are really good designers have historically looked down on them.  But, I am still working on really good so I figure a little backup could come in handy.  Also some nice code examples provided by the blog.

However, as Lee Corso would say, not so fast my friend.  Just as I am thinking I have found salvation, I read http://blog.millermedeiros.com/the-problem-with-css-pre-processors/.   I realize that I still have a great deal to learn about preprocessors before I make any decisions.   The decision about a preprocessor could be more complicated than just figuring out the inheritance problems I have.  I am feeling both sides of this, the part of me that gets stressed thinks it could save time and gray hairs and then the stubborn part of me wants to just work until I get it right.  The stubborn side will probably win, it always has.  I always have to figure it out, and Clairol will just have to deal with the gray hairs.

However, as Lee Corso would say, not so fast my friend. Just as I am thinking I have found salvation, I read http://blog.millermedeiros.com/the-problem-with-css-pre-processors/. I realize that I still have a great deal to learn about preprocessors before I make any decisions. The decision about a preprocessor could be more complicated than just figuring out the inheritance problems I have. I am feeling both sides of this, the part of me that gets stressed thinks it could save time and gray hairs and then the stubborn part of me wants to just work until I get it right. The stubborn side will probably win, it always has. I always have to figure it out, and Clairol will just have to deal with the gray hairs.

Add Comment Register



Leave a Reply