Skip to content

Commit 33222f0

Browse files
committed
elia/twjit: [wip]
1 parent 33e539d commit 33222f0

19 files changed

Lines changed: 151 additions & 381 deletions

File tree

Procfile.dev

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
web: env RUBY_DEBUG_OPEN=true bin/rails server
2-
admin_tailwind: bin/rails solidus_admin:tailwindcss:watch

admin/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ A Rails engine that provides an administrative interface to the Solidus ecommerc
44

55
## Development
66

7-
- [Customizing tailwind](docs/customizing_tailwind.md)
87
- [Customizing view components](docs/customizing_view_components.md)
98
- [Customizing the main navigation](docs/customizing_main_navigation.md)
109

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
/*
2-
* = require solidus_admin/tailwind.css
32
*/

admin/app/assets/stylesheets/solidus_admin/application.tailwind.css.erb

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
<script src="https://cdn.tailwindcss.com/3.3.3?plugins=typography,aspect-ratio"></script>
2+
3+
<style type="text/tailwindcss">
4+
@layer base {
5+
.body-tiny {
6+
@apply font-sans font-normal text-xs;
7+
}
8+
9+
.body-tiny-bold {
10+
@apply font-sans font-semibold text-xs;
11+
}
12+
13+
.body-small {
14+
@apply font-sans font-normal text-sm;
15+
}
16+
17+
.body-small-bold {
18+
@apply font-sans font-semibold text-sm;
19+
}
20+
21+
.body-text {
22+
@apply font-sans font-normal text-base;
23+
}
24+
25+
.body-text-bold {
26+
@apply font-sans font-semibold text-base;
27+
}
28+
29+
.body-title {
30+
@apply font-sans font-semibold text-xl;
31+
}
32+
}
33+
</style>
34+
35+
<script type="module">
36+
import forms from '@tailwindcss/forms'
37+
import containerQueries from '@tailwindcss/forms'
38+
const {defaultTheme} = tailwind
39+
tailwind.config = {
40+
theme: {
41+
extend: {
42+
aria: {
43+
current: 'current="true"',
44+
},
45+
fontFamily: {
46+
sans: ["Inter var", ...defaultTheme.fontFamily.sans],
47+
},
48+
colors: {
49+
transparent: "transparent",
50+
current: "currentColor",
51+
52+
// Primary palette
53+
solidusRed: "#ef3023",
54+
black: "#222222",
55+
graphite: "#c7ccc7",
56+
graphiteLight: "#d8dad8",
57+
sand: "#f5f3f0",
58+
white: "#ffffff",
59+
60+
// Secondary palette
61+
yellow: "#fdc071",
62+
orange: "#f68050",
63+
blue: "#2554b1",
64+
moss: "#2d3925",
65+
forest: "#096756",
66+
midnight: "#163449",
67+
pink: "#f6d7e2",
68+
plum: "#3a0e31",
69+
sky: "#cbdff1",
70+
seafoam: "#c1e0de",
71+
dune: "#e6bf9b",
72+
73+
// Extra colors (not part of the original palette)
74+
papayaWhip: "#f9e3d9",
75+
76+
// UI Red
77+
red: {
78+
100: "#f8d6d3",
79+
200: "#f1ada7",
80+
300: "#ea8980",
81+
400: "#e36054",
82+
500: "#dc3728",
83+
600: "#b12c20",
84+
700: "#862219",
85+
800: "#561610",
86+
900: "#2b0b08",
87+
},
88+
89+
// Grayscale
90+
gray: {
91+
15: "#fafafa",
92+
25: "#f5f5f5",
93+
50: "#f0f0f0",
94+
100: "#dedede",
95+
200: "#cfcfcf",
96+
300: "#bababa",
97+
400: "#a3a3a3",
98+
500: "#737373",
99+
600: "#616161",
100+
700: "#4a4a4a",
101+
800: "#333333",
102+
},
103+
},
104+
borderRadius: {
105+
sm: "4px",
106+
},
107+
backgroundImage: {
108+
"arrow-right-up-line": "url('<%= image_path('solidus_admin/arrow_right_up_line.svg') %>')",
109+
"arrow-down-s-fill-gray-700": "url('<%= image_path('solidus_admin/arrow_down_s_fill_gray_700.svg') %>')",
110+
"arrow-down-s-fill-red-400": "url('<%= image_path('solidus_admin/arrow_down_s_fill_red_400.svg') %>')",
111+
},
112+
boxShadow: {
113+
sm: "0px 1px 2px 0px rgba(0, 0, 0, 0.04)",
114+
base: "0px 4px 8px 0px rgba(0, 0, 0, 0.08), 0px 2px 4px -1px rgba(0, 0, 0, 0.04)",
115+
},
116+
},
117+
},
118+
plugins: [
119+
({ addVariant }) => {
120+
addVariant("hidden", "&([hidden])")
121+
addVariant("visible", "&:not([hidden])")
122+
addVariant("search-cancel", "&::-webkit-search-cancel-button")
123+
},
124+
forms({ strategy: "class" }),
125+
containerQueries(),
126+
],
127+
}
128+
129+
document.addEventListener("turbo:render", () => {
130+
document.body.className += " " // This is a hack to trigger TW's JIT compiler
131+
})
132+
</script>

admin/app/views/layouts/solidus_admin/application.html.erb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
<!DOCTYPE html>
22
<html lang="<%= current_locale %>">
33
<head>
4-
<%= favicon_link_tag 'solidus_admin/favicon.ico' %>
4+
<%= favicon_link_tag "solidus_admin/favicon.ico" %>
55
<title><%= solidus_admin_title %></title>
66
<%= stylesheet_link_tag "solidus_admin/application.css", "inter-font", "data-turbo-track": "reload" %>
77
<%= javascript_importmap_tags "solidus_admin/application", shim: false, importmap: SolidusAdmin.importmap %>
88
</head>
99

1010
<body class="bg-gray-15">
11+
<%= render 'layouts/solidus_admin/tailwindcss_cdn' %>
12+
1113
<%= render component("skip_link").new(href: "#main") %>
14+
1215
<div class="flex gap-0">
1316
<div class="min-w-[240px] border-r border-r-gray-100 relative">
1417
<div class="min-h-screen top-0 sticky flex">

admin/app/views/layouts/solidus_admin/preview.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<%= javascript_importmap_tags "solidus_admin/application", shim: false, importmap: SolidusAdmin.importmap %>
66
</head>
77
<body class="p-3">
8+
<%= render 'layouts/solidus_admin/tailwindcss_cdn' %>
89
<%= yield %>
910
</body>
1011
</html>

admin/config/importmap.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@
77

88
pin "stimulus-use", to: "https://ga.jspm.io/npm:stimulus-use@0.52.0/dist/index.js"
99

10+
pin "tailwindcss", to: "https://cdn.tailwindcss.com/3.3.3?plugins=typography,aspect-ratio"
11+
pin "@tailwindcss/aspect-ratio", to: "https://ga.jspm.io/npm:@tailwindcss/aspect-ratio@0.4.2/src/index.js"
12+
pin "@tailwindcss/container-queries", to: "https://ga.jspm.io/npm:@tailwindcss/container-queries@0.1.1/dist/index.js"
13+
pin "@tailwindcss/forms", to: "https://ga.jspm.io/npm:@tailwindcss/forms@0.5.6/src/index.js"
14+
pin "@tailwindcss/typography", to: "https://ga.jspm.io/npm:@tailwindcss/typography@0.5.10/src/index.js"
15+
16+
pin "mini-svg-data-uri", to: "https://ga.jspm.io/npm:mini-svg-data-uri@1.4.4/index.js"
17+
pin "picocolors", to: "https://ga.jspm.io/npm:picocolors@1.0.0/picocolors.browser.js"
18+
pin "tailwindcss/colors", to: "https://ga.jspm.io/npm:tailwindcss@3.3.3/colors.js"
19+
pin "tailwindcss/defaultTheme", to: "https://ga.jspm.io/npm:tailwindcss@3.3.3/defaultTheme.js"
20+
pin "tailwindcss/plugin", to: "https://ga.jspm.io/npm:tailwindcss@3.3.3/plugin.js"
21+
1022
pin "solidus_admin/application", preload: true
1123
pin "solidus_admin/utils"
1224
pin_all_from SolidusAdmin::Engine.root.join("app/javascript/solidus_admin/controllers"), under: "solidus_admin/controllers"

admin/config/solidus_admin/tailwind.config.js.erb

Lines changed: 0 additions & 95 deletions
This file was deleted.

0 commit comments

Comments
 (0)