⚠ Global CSS


🟢 Bileşen Bazlı CSS

  1. CSS Modules
/* PageNav.module.css */
.nav {
  background-color: #f0f0f0;
}

import styles from './PageNav.module.css';

function PageNav() {
  return <nav className={styles.nav}>Menu</nav>;
}

:global(.test) {
  color: red;
}

  1. Inline Styles (JS içinde stil)
const style = { backgroundColor: 'blue', padding: '10px' };
<div style={style}>Hello</div>

  1. <style> etiketi kullanımı
function Component() {
  return (
    <><style>{`
        .title { color: green; }
      `}</style>
      <h1 className="title">Hello</h1>
    </>
  );
}

  1. Utility-First CSS (Tailwind gibi)
<div className="bg-blue-500 p-4 text-white">Hello</div>