Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hatch: <type> <colour-name> results in parsing error #4605

Closed
davep opened this issue Jun 5, 2024 · 1 comment · Fixed by #4606
Closed

hatch: <type> <colour-name> results in parsing error #4605

davep opened this issue Jun 5, 2024 · 1 comment · Fixed by #4606
Labels
bug Something isn't working

Comments

@davep
Copy link
Contributor

davep commented Jun 5, 2024

According to the docs for hatch you can do something like this:

hatch: cross red;

however, if I try that:

from textual.app import App

class HatchApp(App[None]):

    CSS = """
    Screen {
        hatch: cross red;
    }
    """

if __name__ == "__main__":
    HatchApp().run()

I get the following error:


╭─ Error at /Users/davep/develop/python/textual-sandbox/test_hatch.py in HatchApp.CSS:3:16 ──────────────────────────────────────────────╮
│   1 │                                                                                                                                  │
│   2 │   Screen {                                                                                                                       │
│ ❱ 3 │   │   hatch: cross red;                                                                                                          │
│   4 │   }                                                                                                                              │
│   5                                                                                                                                    │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
   Invalid value for the hatch property                                                                                                   
   ├── The hatch property can only be set to 'cross', 'horizontal', 'left', 'right', or 'vertical'                                        
   └── Assign any of the valid strings to the property                                                                                    
         e.g. hatch: cross;                                                                                                               
         e.g. hatch: horizontal;                                                                                                          
         e.g. hatch: left;                                                                                                                
         e.g. hatch: right;                                                                                                               
         e.g. hatch: vertical;                                                                                                            
                                                                                                                                          

 CSS parsing failed: 1 error found in stylesheet

on the other hand this is fine:

from textual.app import App

class HatchApp(App[None]):

    CSS = """
    Screen {
        hatch: cross #f00;
    }
    """

if __name__ == "__main__":
    HatchApp().run()
@davep davep added the bug Something isn't working label Jun 5, 2024
davep added a commit to davep/textual-sandbox that referenced this issue Jun 5, 2024
Copy link

github-actions bot commented Jun 5, 2024

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant