-
Notifications
You must be signed in to change notification settings - Fork 0
Style Guide
Tom Magnusson edited this page Apr 3, 2018
·
3 revisions
We use (all languages):
- Two spaces for indentation
- Egyptian curly brace blocks
- Descriptive:
- Comments
- Variable names
- Function names
Example:
/// Updates the nav item to reflect which page you're on (turn it gray when you're on about_us, for example)
function updateNavItemSelected() {
// don't want color change on these pages
if(location != "index.html") {
// changes color on the nav bar depending which screen you are on
const page = document.getElementById("page");
if(page !== null) {
$(page.content).css({"color": "#535353"});
}
}
}
-
lowerCamelCase
for-
variable names in
- JavaScript:
var modalShouldBeShown
- PHP:
$firstName
- JavaScript:
-
function names in JavaScript:
function renderNavBar()
-
variable names in
-
lower-dash-case
for-
class names in CSS:
flavor-text
-
id names in HTML:
meet-the-team-header
-
class names in CSS:
-
lower_snake_case
for-
files:
meet_the_team.html
,activities_fair.jpg
-
function names in PHP:
function arrayFilter()
-
files:
<script src="../js/script.js"></script>
- Home
- CIO
- Words of Wisdom
- Developers
- Designers
- Web Applications
- Making Changes
- Infrastructure
- Resources
- Key Contacts
- Future Plans