Skip to content

Commit 0133dff

Browse files
committed
elia/twjit: [wip]
1 parent d479d6a commit 0133dff

File tree

19 files changed

+153
-382
lines changed

19 files changed

+153
-382
lines changed

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

0 commit comments

Comments
 (0)