Skip to content

Commit

Permalink
Fix tests and README
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrick committed Mar 7, 2024
1 parent df89f8a commit ecb282a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ A Lektor plugin that adds Tailwind CSS to your project seamlessly.

```javascript
module.exports = {
content: ['./templates/**/*.{html,j2}'],
// './' refers to the lektor build output directory, NOT the project dir
content: ['./**/*.html'],
theme: {
extend: {},
},
Expand Down
5 changes: 4 additions & 1 deletion lektor_tailwind.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ def _get_tailwind_args(self, output_path, *extra_args):
def input_exists(self) -> bool:
return os.path.exists(self.input_css)

def should_minify(self) -> bool:
return not self.watch or os.environ.get("NODE_ENV") == "production"

def compile_css(self, output_path: str):
minify = [] if self.watch else ["--minify"]
minify = ["--minify"] if self.should_minify() else []
subprocess.run(
self._get_tailwind_args(output_path, *minify),
check=True,
Expand Down
2 changes: 1 addition & 1 deletion tests/example/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const colors = require("tailwindcss/colors");

module.exports = {
content: ["./templates/**/*.html"],
content: ["./**/*.html"],
theme: {
extend: {
colors: {
Expand Down

0 comments on commit ecb282a

Please sign in to comment.