Skip to content

Commit 58ed36a

Browse files
committed
Custom class input css
1 parent 6cbf837 commit 58ed36a

4 files changed

Lines changed: 24 additions & 13 deletions

File tree

tailwind/Example1/src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</head>
99
<body class="bg-blue-400">
1010
<div class="container mx-auto px-2">
11-
<button class="bg-blue-500 hover:bg-blue-400 text-white py-2 px-4 rounded">Press</button>
11+
<button class="btn bg-blue-500 hover:bg-blue-400 text-white py-2 px-4 rounded">Press</button>
1212
</div>
1313
</body>
1414
</html>

tailwind/Example1/src/input.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
@tailwind base;
22
@tailwind components;
3-
@tailwind utilities;
3+
@tailwind utilities;
4+
5+
.btn {
6+
@apply font-bold
7+
}

tailwind/Example1/src/style.css

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,10 @@ video {
546546

547547
.container {
548548
width: 100%;
549+
margin-right: auto;
550+
margin-left: auto;
551+
padding-right: 4rem;
552+
padding-left: 4rem;
549553
}
550554

551555
@media (min-width: 640px) {
@@ -587,11 +591,6 @@ video {
587591
border-radius: 0.25rem;
588592
}
589593

590-
.bg-red-500 {
591-
--tw-bg-opacity: 1;
592-
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
593-
}
594-
595594
.bg-blue-400 {
596595
--tw-bg-opacity: 1;
597596
background-color: rgb(96 165 250 / var(--tw-bg-opacity));
@@ -602,26 +601,30 @@ video {
602601
background-color: rgb(59 130 246 / var(--tw-bg-opacity));
603602
}
604603

605-
.py-2 {
606-
padding-top: 0.5rem;
607-
padding-bottom: 0.5rem;
604+
.px-2 {
605+
padding-left: 0.5rem;
606+
padding-right: 0.5rem;
608607
}
609608

610609
.px-4 {
611610
padding-left: 1rem;
612611
padding-right: 1rem;
613612
}
614613

615-
.px-2 {
616-
padding-left: 0.5rem;
617-
padding-right: 0.5rem;
614+
.py-2 {
615+
padding-top: 0.5rem;
616+
padding-bottom: 0.5rem;
618617
}
619618

620619
.text-white {
621620
--tw-text-opacity: 1;
622621
color: rgb(255 255 255 / var(--tw-text-opacity));
623622
}
624623

624+
.btn {
625+
font-weight: 700;
626+
}
627+
625628
.hover\:bg-blue-400:hover {
626629
--tw-bg-opacity: 1;
627630
background-color: rgb(96 165 250 / var(--tw-bg-opacity));

tailwind/Example1/tailwind.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
module.exports = {
33
content: ["./src/*.{html,js}"],
44
theme: {
5+
container: {
6+
center: true,
7+
padding: '4rem',
8+
},
59
extend: {},
610
},
711
plugins: [],

0 commit comments

Comments
 (0)