diff --git a/colormaestro/formatters/css.py b/colormaestro/formatters/css.py index 9ad8999..6334347 100644 --- a/colormaestro/formatters/css.py +++ b/colormaestro/formatters/css.py @@ -11,6 +11,9 @@ def generate(palette): Returns: str: CSS variables definition """ + if not palette: + return ":root {\n}\n" + css = ":root {\n" # Add color variables diff --git a/tests/test_generators.py b/tests/test_generators.py index 6339288..d0a716b 100644 --- a/tests/test_generators.py +++ b/tests/test_generators.py @@ -188,7 +188,7 @@ def test_basic_generation(self): def test_dark_mode(self): """Test dark mode UI palette generation""" base_color = SAMPLE_COLORS['blue'] - palette = ui_palette.generate(base_color, 5, dark=True) + palette = ui_palette.generate(base_color, 5, dark_mode=True) # Check that the palette has the correct length assert len(palette) == 5