.{breakpoint}:{...classes}
Breakpoints | Starts at |
---|---|
[ALL] sm: md: lg: xl: | 0px 640px 768px 1024px 1280px |
Responsive Classes | |
---|---|
.{sm}:bg- .{sm}:w- .{sm}:h- .{sm}:p- .{sm}:m- | background color width height padding margin |
Responsive Classes ( 예시 ) | |
---|---|
.sm:font-sans .sm:text-lg .sm:text-left .sm:text-{color}-{shade} .sm:font-bold .sm:tracking-tighter .sm:uppercase .sm:border-{color}-{shade} .sm:border-{style} .sm:border-{width} .sm:rounded-{size} .sm:{display} .sm:flex .sm:flex-{col|row} |
<!DOCTYPE html>
<html lang="en">
<body class="bg-blue-500 md:bg-red-500">
<div class="p-4 md:font-bold md:italic">Hello World</div>
</body>
</html>
.hover:{...classes}
Hover Clases | |
---|---|
.hover:bg- .hover:text-{color}-{shade} .hover:font-bold .hover:border-{color}-{shade} |
<!DOCTYPE html>
<html lang="en">
<body>
<div>
<button
class="bg-blue-500 hover:bg-blue-700 text-white py-2 px-4 rounded"
>
Submit
</button>
</div>
</body>
</html>
.focus:{...classes}
Hover Classes | |
---|---|
.focus:bg- .focus:text-{color}-{shade} .focus:font-bold .focus:border-{color}-{shade} |
<!DOCTYPE html>
<html lang="en">
<body>
<div>
<input class="focus:bg-blue-200 border border-gray-300" type="text" />
</div>
</body>
</html>
.{breakpoint}:{mod}:{...classes}
Hover Classes | |
---|---|
.md:hover:bg-{color}-{shade} .md:focus:bg-{color}-{shade} .md:hover:text-{color}-{shade} .md:focus:text-{color}-{shade} |
<!DOCTYPE html>
<html lang="en">
<body>
<div>
<input
class="sm:hover:bg-red-500 border border-gray-300"
type="text"
/>
</div>
</body>
</html>
.shadow-{size}
Size | |
---|---|
md lg xl 2xl inner outline none |
<!DOCTYPE html>
<html lang="en">
<body>
<div
class="shadow-2xl bg-blue-800 text-blue-200 w-40 h-40 flex justify-center items-center"
>
Hellow World
</div>
</body>
</html>
// 100~0
.opacity-{percent}
<!DOCTYPE html>
<html lang="en">
<body>
<div
class="opacity-50 shadow-2xl bg-blue-800 text-blue-200 w-40 h-40 flex justify-center items-center"
>
Hellow World
</div>
</body>
</html>
.cursor-{style}
Styles | |
---|---|
default pointer wait text move not-allowed |
<!DOCTYPE html>
<html lang="en">
<body>
<div
class="cursor-move bg-blue-800 text-blue-200 w-40 h-40 flex justify-center items-center"
>
Hellow World
</div>
</body>
</html>
.select-{style}
Styles | |
---|---|
none text all auto |
<!DOCTYPE html>
<html lang="en">
<body>
<div
class="select-all bg-blue-800 text-blue-200 w-40 h-40 flex justify-center items-center"
>
Hellow World
</div>
</body>
</html>
.sr-only
.not-sr-only
<!DOCTYPE html>
<html lang="en">
<body>
<div
class="select-all bg-blue-800 text-blue-200 w-40 h-40 flex justify-center items-center"
>
Hellow World
</div>
</body>
</html>
module.exports = {
darkMode: 'class',
// ...
}
dark:
프리픽스를 사용해서 변경할 부분을 넣어줍니다.dark
라는 클래스를 상위에 넣어서 다크모드를 컨트롤 합니다.<!-- Dark mode not enabled -->
<html>
<body>
<!-- Will be white -->
<div class="bg-white dark:bg-black">
<!-- ... -->
</div>
</body>
</html>
<!-- Dark mode enabled -->
<html class="dark">
<body>
<!-- Will be black -->
<div class="bg-white dark:bg-black">
<!-- ... -->
</div>
</body>
</html>