Skip to content

Instantly share code, notes, and snippets.

View renatoam's full-sized avatar
💭
always playing javascript...

Renato Melo renatoam

💭
always playing javascript...
View GitHub Profile
@renatoam
renatoam / fonts-optimization.css
Created July 11, 2020 02:13
Guia bem breve e sucinto sobre a utilização correta do @font-face
/* Caso não tenha todos os formatos da sua font (os que te interessam), pode converter online */
@font-face {
/* Controla o comportamento de exibição de uma font personalizada (font-face) */
font-display: optional;
/* Nome da font */
font-family: 'Soleto';
/* Verifica se a font já existe localmente, evitando download desnecessário da font (se existir localmente) */
src: local('Soleto'),
/* Formato mais moderno e mais leve; se o browser for compatível, os demais são ignorados */
url('arquivos/soleto.woff2') format('woff2'), /* Modern Browsers */
@renatoam
renatoam / reset.css
Last active February 17, 2023 00:30
Modern Reset CSS - Some great (and famous) resets plus mine
/*
Remove all the styles of the "User-Agent-Stylesheet", except for the 'display' property
- The "symbol *" part is to solve Firefox SVG sprite bug
*/
*:where(:not(html, iframe, canvas, img, svg, video, audio):not(svg *, symbol *)) {
all: unset;
display: revert;
}
/* Preferred box-sizing value */
@renatoam
renatoam / utilities.css
Created October 11, 2022 21:04
Some CSS utilities quite useful in any responsive project
/* Utilities */
/* Automatic Grids */
.auto-grid {
/* ch is the size of the "0" character of a font; it's important to some UX good practices like limiting text containers in 60 character, for example. */
--min: 60ch;
--gap: 1rem;
display: grid;