Google Material Color dan Icons 2014 Masih Solusi Cepat Mendesain
Material Design 2 yang dirilis oleh Google ke publik pada tahun 2014 memiliki tools yang sampai sekarang masih berguna dan sangat mudah digunakan, yaitu:
Google Fonts
Memasang iconnya secara langsung lewat CDN dari Google Fonts seperti ini
<link rel="preconnect" href="https://fonts.googleapis.com"/>
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/>
<link href="https://fonts.googleapis.com/css2?family=Noto+Serif:wght@400;700&display=swap" rel="stylesheet"/>
Atau pasang dengan cara self-hosting iconnya seperti ini
@font-face {
font-family: 'Noto Serif';
font-style: normal;
font-weight: 400;
font-stretch: 100%;
font-display: swap;
src: url(“../NotoSerif-Regular.woff2”) format('woff2');
}
@font-face {
font-family: 'Noto Serif';
font-style: normal;
font-weight: 700;
font-stretch: 100%;
font-display: swap;
src: url(“../NotoSerif-Bold.woff2”) format('woff2');
}
body {
font-family: 'Noto Serif';
}
Material Icons
Memasang iconnya secara langsung lewat CDN dari Google Fonts seperti ini
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
Atau pasang dengan cara self-hosting iconnya seperti ini
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(../MaterialIcons-Regular.woff2) format('woff2');
}
.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px; /* Preferred icon size */
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;
/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;
/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;
/* Support for IE. */
font-feature-settings: 'liga';
}
Material Design color palettes
Cara Menggunakan cukup kunjungi website-nya di sini dan salin kode hex-nya.
Cara menggunakan hex warna di CSS cukup hanya menyalin contoh color: #FFEBEE.
Sementara di Flutter adalah dengan Color(0xFF[Hex]), contoh Color(0xFFFFEBEE)
Related Posts
Best Practice-nya Zustand Persist di Next.js Sesuai Dokumentasi
Pada artikel sebelumnya, Saya membahas bagaimana Saya menggunakan Zustand untuk dapat mengelola data yang telah di-input user. Dalam pengerjaan proyek, Saya menyadari perlu untuk menyimpan data di loc...
Implementasi Light dan Dark Mode di Web itu Mudah
Pendahuluan# Sudah umum kalau device terkini memiliki fitur light dan dark mode terpasang di operating system bawaan. Masalah# Tapi terkadang fitur ini masih belum kita bisa temukan di website yang ki...