Creating and Using Snippets
Snippets are a very useful ways to code quickly. You can create snippets by hitting the snippets tab and creating new or creating new from clipboard. The $# is useful so once you create a new snippet you can hit tab and your coursor will go to that place.
<article>
<h1>Lab-number</lth1>
<section>
<h1>title</lth1>
<p>description</ltp>
</ltsection>
</ltarticle>
<section>
<h1>title</lth1>
<p>desciption</ltp>
</ltsection>
SCSS
Using SCSS over CSS is useful because you can make changes to one place rather than every place where there is a color. Also it just seems like it is smarter and there is more tricks for it.
Origional CSS
body {
padding-top: 50px;
}
#Invoice {
float: right;
font-size: 36px;
}
table {
width: 100%;
border-collapse: collapse;
border: medium solid #000;
margin-bottom: 25px;
}
#OrderInfo td:nth-child(odd),
#Addresses td:nth-child(odd) {
text-align: right;
padding-right: 10px;
}
#OrderInfo td:nth-child(odd), #Addresses td:nth-child(odd) {
text-align: right;
padding-right: 10px;
}
#OrderInfo td:nth-child(odd)::after, #Addresses td:nth-child(odd)::after {
content: ":";
}
#OrderInfo td:nth-child(even), #Addresses td:nth-child(even) {
border: 1px solid #000;
padding-left: 10px;
text-align: left;
}
#Addresses tr:first-child td:nth-child(even) {
border: none;
}
.AddressType {
text-decoration: underline;
padding-left: 10px;
}
.numeric {
text-align: right;
padding-right: 10px;
}
#CompanyAddress {
font-size: 16px;
}
.subtotals td {
border-top: solid medium black;
}
#OrderDetailsTable .subtotals td, #OrderDetailsTable .shipping td, #OrderDetailsTable .total td {
border-left: none;
}
#OrderDetailsTable td, #OrderDetailsTable th {
border-left: 1px solid black;
}
#OrderDetailsTable th {
font-weight: bold;
color: #FFF;
background-color: #036;
text-align: left;
font-size: 16px;
}
#OrderDetailsTable tr *:not([class=numeric]) {
padding-left: 10px;
}
#Footer {
font-family: "Segoe Script", Arial, sans-serif;
font-size: 18px;
color: #036;
text-align: center;
}
#header {
color: #036;
}/*# sourceMappingURL=invoice.css.map */
Final SCSS
$hopeBlue: #036;
body {
padding-top: 50px;
}
#Invoice {
float: right;
font-size: 36px;
}
table {
width: 100%;
border-collapse: collapse;
border: medium solid #000;
margin-bottom: 25px;
}
#OrderInfo td:nth-child(odd),
#Addresses td:nth-child(odd) {
text-align: right;
padding-right: 10px;
}
// #OrderInfo td:nth-child(odd)::after,
// #Addresses td:nth-child(odd)::after {
// content: ':'
// }
#OrderInfo, #Addresses{
td:nth-child(odd){
text-align: right;
padding-right: 10px;
&::after{
content: ":";
}
}
td:nth-child(even){
border: 1px solid #000;
padding-left: 10px;
text-align: left;
}
}
#Addresses tr:first-child td:nth-child(even) {
border: none;
}
// #OrderInfo td:nth-child(even),
// #Addresses td:nth-child(even) {
// border: 1px solid #000;
// padding-left: 10px;
// text-align: left;
// }
.AddressType {
text-decoration: underline;
padding-left: 10px;
}
.numeric {
text-align: right;
padding-right: 10px;
}
#CompanyAddress {
font-size: 16px;
}
.subtotals td {
border-top: solid medium black;
}
// #OrderDetailsTable .subtotals td,
// #OrderDetailsTable .shipping td,
// #OrderDetailsTable .total td {
// border-left: none;
// }
// #OrderDetailsTable td,
// #OrderDetailsTable th {
// border-left: 1px solid black;
// }
// #OrderDetailsTable tr *:not([class='numeric']) {
// padding-left: 10px;
// }
// #OrderDetailsTable th {
// font-weight: bold;
// color: #FFF;
// background-color: $hopeBlue;
// text-align: left;
// font-size: 16px;
// }
#OrderDetailsTable{
.subtotals td, .shipping td, .total td{
border-left:none;
}
td, th{
border-left: 1px solid black;
}
th{
font-weight: bold;
color: #FFF;
background-color: $hopeBlue;
text-align: left;
font-size: 16px;
}
tr *:not([class='numeric']) {
padding-left: 10px;
}
}
#Footer {
font-family: "Segoe Script", Arial, sans-serif;
font-size: 18px;
color: $hopeBlue;
text-align: center;
}
#header {
color: $hopeBlue;
}