A Code Style Guideline
This document was written to keep the code written for all my projects consistent, thus saying, it is for personal use, althought you may find it useful as well.
I decided to use the Tufte CSS theme framework for this document because it is easily legible, and lends well to code documentation. Credits for this theme must go to Edward Tufte, after whom the theme is named, and the developer of the code, based upon Tufte's works.
The original CSS for this theme can be found here on GitHub. I simply converted the theme to stylus and added a few personal touches.
My contribution to this theme mainly involves adding navigation to the document and a few minor touches here and there. Which, sadly, does not appear to work on mobile devices, yet.
To start out, I will discuss a few things that will remain the same no matter what type of code I'm writing.
It doesn't matter whether I'm working on HTML, CSS, JS, PHP, or anything else, certain things will be done certain ways; for example...
I, personally hate plain css, I have never used plain CSS in any project. I prefer preprocessors such as less, sass, or stylus. so they are what I will discuss.
Some things, however, are fairly universal across all languages, for example...
I never use original Sass, if I want a whitespace dependent preprocessor, I go with Stylus. The version of Sass that I do use is called SCSS, and, just like normal CSS, it requires proper punctuation.
The file structure for my SCSS files varies depending on the complexity of the project I'm working on, but will always have these basics:
Where the first list item is the main scss folder, inside which all scss files should go. All files that get included into another scss file should begin with '_' for it's name.