-
Notifications
You must be signed in to change notification settings - Fork 1
/
options.go
55 lines (45 loc) · 1.35 KB
/
options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package tailo
var (
// configPath is the path to the TailwindCSS configuration file.
configPath = "config/tailwind.config.js"
// inputPath is the path to the input file, the one with @apply rules.
inputPath = "web/assets/application.css"
// outputPath is the path to the output file, the one with compiled CSS.
outputPath = "web/public/application.css"
// binaryPath is the path to the TailwindCSS CLI binary.
binaryPath = "bin/tailwindcss"
)
type Option func()
// UseConfigPath sets the path to the TailwindCSS configuration file
// otherwise it defaults to "config/tailwind.config.js".
func UseConfigPath(path string) Option {
return func() {
configPath = path
}
}
// UseInputPath sets the path to the input file, the one with @apply rules
// otherwise it defaults to "web/assets/application.css".
func UseInputPath(path string) Option {
return func() {
inputPath = path
}
}
// UseOutputPath sets the path to the output file, the one with compiled CSS
// otherwise it defaults to "web/public/application.css".
func UseOutputPath(path string) Option {
return func() {
outputPath = path
}
}
// UseBinaryPath sets the path to the TailwindCSS CLI binary otherwise it
// defaults to "bin/tailwindcss".
func UseBinaryPath(path string) Option {
return func() {
binaryPath = path
}
}
func UseVersion(v string) Option {
return func() {
version = v
}
}