After first paint
Lee Blazek
2023
After time to first paint
| HTML | Jade, pug, EJS, marko, handlebars, mustache | mostly server side rendered. backbone/marionette, jquery, etc |
|---|---|---|
| CSS | Sass, scss, stylus, less | have their own preprocessor |
| JS | ES, 7, TS, Coffeescript | Usually need bundler (webpack, babel, etc) |
lists (ol, ul, dl) - super useful
| Content sectioning | html, Main, nav, section, aside, footer, header, h1,h2,.. |
| Block level | div, lists(ul, ol, ..), ng component selectors(dps-card) |
| inline | span, b, i, strong, a, small |
Fewer diverse tags, means less CSS, better for SEO and Accessibility, performance, writing e2e tests
in other words no "divitis", "classitis", "span mania"
Use css before JS
pseudo classes / combinators
CSS
| :hover | |
| :first-child | |
| :last-child | |
| :nth-child | https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-child |
| :before | |
| :after | |
| > | The > combinator selects nodes that are direct children of the first element. |
SCSS nesting and parent selector
SCSS SYNTAX
nav {
ul {
margin: 0;
padding: 0;
list-style: none;
}
li { display: inline-block; }
a {
display: block;
padding: 6px 12px;
text-decoration: none;
&:hover {
background: red;
}
}
}nav ul {
margin: 0;
padding: 0;
list-style: none;
}
nav li {
display: inline-block;
}
nav a {
display: block;
padding: 6px 12px;
text-decoration: none;
}
nav a:hover {
background:red;
}
For simpler peices of layout (bootstrap has them also)
Better for whole page layout stuff
<div class="pl-3 pt-1 font-weight-light">
By {{problem?.physician}}
<small class="float-right"
*ngIf="problem.clinicalStatus == 'Resolved'">
Resolved
</small>
</div>
If an angular app sends a date "1/1/2019" to a java(or other api) typed as Int or number, etc it will throw error?
If a server (java or any) sends a date "1/1/2019" to a typescript app(angular, react, etc) that is typed in typescript as number will it throw error?
to typecheck in browser you need to use "typeof" var