Skip to main content
Commercial Photography

A Guide for CSS Style Sheet

Every CSS author has his preferred way of writing code. For example, a few peoples, prefer to write each property and selector on a separate line, while other would everything on one single line instead of separate line. Some writer/authors never add a semicolon to the last property on a selector (because it isn’t necessary); others prefer to remove the space between the colon and the value of a property. The list goes on. These are just a few examples of how divergent CSS authoring can be from person to person, look into any CSS discussion forum and you will find endless ongoing debates on each of these topics, and many more. You will also probably come to the conclusion that no one is fully right or wrong, there are valid arguments on each side of the fence. However, when dealing with large-scale style sheets, or style sheets that are to be applied to large-scale websites where performance and robustness are the most important factors/aspects, personal preferences usually have to be set aside to give way to a more flexible, logical/coherent way of writing the code. 
A-Guide-for-CSS-Style-Sheet
You may also like this article: CSS Stylish Table
This approach will not be the most effective at the start (a newly hired developer will have to adapt to the conventions used in the organization, so he won’t be able to immediately start coding without becoming familiar with them), but it will make it easier for staff to edit and update style sheets created by other developers without having to take the time to understand (sometimes the correct word would be “decipher”) and become familiar with someone else’s CSS writing style. Having a set of conventions in place will also make it easier for authors to know which path to take. Even though there is always a degree of subjectivity when creating CSS solutions, if a CSS style guide is in place, many of the doubts will become non-existent since there are “rules” to be followed. It also becomes easier to detect errors, typos, and mistakes. This chapter focuses on the most important points where CSS authoring can be made more consistent and efficient. You will learn the following:
  • Why you should have a CSS style guide in place
  • Effective ways of formatting CSS
  • How to use CSS comments in a useful way
  • Best practices on ID and class naming
  • Namespacing
You may also like this article: CSS Blurry Text
If you are producing a CSS style guide (as we recommend) that will be known and used by all the members of the team, it can and should include a reference to how CSS is formatted. This will make reading style sheets created by others easier and it will remove part of the subjectivity that is common among CSS authors when creating or editing the files. It should also indicate how comments should be made and encourage the use of them.
bbc-css-style-sheet
You may also like this article: Wordpress Site Architecture

Creating and implementing a CSS style guide will remove some of the inconsistency that is often related to coding CSS, where different developers have different coding styles that can sometimes be extremely difficult for other people to read and understand. This slows down the development process and promotes errors, redundancy, and code bloat. A style guide is an instrumental tool to avoid this, allowing for code re-usability and efficiency through consistency, for a streamlined team environment for developing high-traffic sites. Companies such as the BBC or Drupal have CSS style guides in place that are publicly available and act as good references for anyone who is creating one.
drupal-css-style-sheet
You may also like this article: CSS Subscription Gadget

Comments

Popular posts from this blog

New Fifty Shades Darker poster drops

New Fifty Shades Darker poster drops The brand new poster for Fifty Shades Darker , starring Jamie Dornan and Dakota Johnson has just dropped. It comes ahead of the new New Fifty Shades Darker trailer release tomorrow.

Commets, Varialbles & Special Keywords

Comments Javascript supports two types of comments. Double-slashes (//) tell javascript to ignore everything to the end of the line. You will see them used most often to describe what is happening on a particular line. var x=5; // Everything from the // to end of line is ignored(*) var thingamajig=123.45; // 2 times the price of a whatsit. "Blockquotes" begin a comment block with a slash-asterisk (/*) and Javascript will ignore everything from the start of the comment block until it encounters an asterisk-slash (*/). Blockquotes are useful for temporally disabling large areas of code, or describing the purpose of a function, or detailing the purpose and providing credits for the script itself.  function whirlymajig(jabberwocky) {    /* Here we take the jabberwocky and insert it in the gire-gimble, taking great care to observe the ipsum lorum!   For bor-rath-outgrabe! We really should patent this! */    return (jabberwocky*2); } You should note that...

The Magnificent Seven: Film Review

The Magnificent Seven: Film Review Cast: Denzel Washington, Chris Pratt, Ethan Hawke, Vincent D'Onofrio, Manuel Garcia-Rulfo, Martin Sensmeier, Byung-hun Lee, Peter Sarsgaard Director: Antoine Fuqua Rote and without a hint of much of his own style, The Magnificent Seven somehow manages to feel like a weaker carbon copy than a redo of the 1960s classic. This time around, Denzel Washington leads the pack as Sam Chisholm, a newly sworn warrant officer. Riding into town with nary a comment but with every head turning as a black man heads down their street, Chisholm is asked by widowed Emma Cullen (a largely underused but pleasingly effective Haley Bennett) to avenge her husband's death and free their mining town from the tyrannical grip of Bartholomew Bogue (Sarsgaard). Gathering up a motley crew of multi-racial misfits (one of the more revisionist edges that Fuqua gifts the reboot), Chisholm and his man saddle up for a fight. The Magnificent Seven is nothing in comparison to the...