textual icon indicating copy to clipboard operation
textual copied to clipboard

CSS_PATH is missing in Widget

Open mzebrak opened this issue 2 years ago • 1 comments

I think it will be very useful if CSS_PATH could be usable in Widget instances also, like it is already available in e.g App or Screen.

You could use live css to create advanced widgets. And I think it would be consistent in general.

This also allows you to make a choice. For example, in our application we try to separate the entire CSS into files - so we have created an appropriate function for this, which is simple and with the oneliner call it searches for a specific CSS file, reads its content and allows it to be inserted into DEFAULT_CSS like DEFAULT_CSS = get_relative_css(__file__). But this means that we are not able to use live reloading for such widgets (could be still workaround by working on the CSS file given in the Screen CSS_PATH).

mzebrak avatar Dec 07 '23 13:12 mzebrak

We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

github-actions[bot] avatar Dec 07 '23 13:12 github-actions[bot]

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

github-actions[bot] avatar Jun 17 '24 20:06 github-actions[bot]

@willmcgugan I see this is now closed without a note - is this idea rejected or will be available anytime soon?

mzebrak avatar Jun 17 '24 21:06 mzebrak