Skip to content

Commit a47cc72

Browse files
committed
Extract separate files and css layer for utilities
1 parent 4b9f8a1 commit a47cc72

File tree

4 files changed

+46
-70
lines changed

4 files changed

+46
-70
lines changed

app/javascript/css/application.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@layer reset, theme, layout;
1+
@layer reset, theme, layout, utilities;
22

33
@import './reset.css' layer(reset);
44

@@ -15,7 +15,9 @@
1515
@import './config/grid.css' layer(layout);
1616
@import './layout.scss' layer(layout);
1717

18-
@import './utilities.css';
18+
@import './utilities/tailwind.css';
19+
@import './utilities/tailwind-media.scss';
20+
@import './utilities/custom.css';
1921

2022
@import './components/logo.css';
2123
@import './components/button.css';

app/javascript/css/utilities/custom.css

Whitespace-only changes.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
@import '../config/variables.scss';
2+
3+
@media screen and (min-width: $screen-md) {
4+
.md\:mt-3 {
5+
margin-top: 0.75rem;
6+
}
7+
.md\:mr-4 {
8+
margin-right: 1rem;
9+
}
10+
.md\:w-\[20px\] {
11+
width: 20px;
12+
}
13+
.md\:p-2 {
14+
padding: 0.5rem;
15+
}
16+
.md\:text-base {
17+
font-size: 1rem;
18+
line-height: 1.5;
19+
letter-spacing: -0.017em;
20+
}
21+
.md\:top-\[3px\] {
22+
top: 3px;
23+
}
24+
.md\:left-\[-72px\] {
25+
left: -72px;
26+
}
27+
}
28+
29+
@media screen and (min-width: $screen-lg) {
30+
.lg\:text-left {
31+
text-align: left;
32+
}
33+
.lg\:text-right {
34+
text-align: right;
35+
}
36+
37+
.lg\:py-3xl {
38+
padding-top: var(--space-3xl);
39+
padding-bottom: var(--space-3xl);
40+
}
41+
}

app/javascript/css/utilities.css renamed to app/javascript/css/utilities/tailwind.css

Lines changed: 1 addition & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import 'config/variables.scss';
1+
/* Utilities copied from tailwind */
22

33
.sr-only {
44
position: absolute;
@@ -885,38 +885,6 @@
885885
width: 16px;
886886
}
887887

888-
@media (min-width: 768px) {
889-
.md\:w-\[20px\] {
890-
width: 20px;
891-
}
892-
}
893-
894-
@media (min-width: 768px) {
895-
.md\:p-2 {
896-
padding: 0.5rem;
897-
}
898-
}
899-
900-
@media (min-width: 768px) {
901-
.md\:text-base {
902-
font-size: 1rem;
903-
line-height: 1.5;
904-
letter-spacing: -0.017em;
905-
}
906-
}
907-
908-
@media (min-width: 768px) {
909-
.md\:top-\[3px\] {
910-
top: 3px;
911-
}
912-
}
913-
914-
@media (min-width: 768px) {
915-
.md\:left-\[-72px\] {
916-
left: -72px;
917-
}
918-
}
919-
920888
.group:hover .group-hover\:opacity-60 {
921889
opacity: 0.6;
922890
}
@@ -933,17 +901,6 @@
933901
display: none;
934902
}
935903

936-
@media (min-width: 768px) {
937-
.md\:mt-3 {
938-
margin-top: 0.75rem;
939-
}
940-
}
941-
@media (min-width: 768px) {
942-
.md\:mr-4 {
943-
margin-right: 1rem;
944-
}
945-
}
946-
947904
focus\:ring-0:focus {
948905
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0
949906
var(--tw-ring-offset-width) var(--tw-ring-offset-color);
@@ -971,27 +928,3 @@ focus\:ring-0:focus {
971928
.text-right {
972929
text-align: right;
973930
}
974-
975-
/* Custom utilities */
976-
977-
.py-gap {
978-
padding-top: var(--grid-gutter);
979-
padding-bottom: var(--grid-gutter);
980-
}
981-
982-
@media screen and (min-width: $screen-md) {
983-
}
984-
985-
@media screen and (min-width: $screen-lg) {
986-
lg\:text-left {
987-
text-align: left;
988-
}
989-
lg\:text-right {
990-
text-align: right;
991-
}
992-
993-
lg\.py-3xl {
994-
padding-top: var(--space-3xl);
995-
padding-bottom: var(--space-3xl);
996-
}
997-
}

0 commit comments

Comments
 (0)