Merge pull request #811 from gradio-app/custom_css_per_component

Adding custom css kwarg directly to a component [WIP]
This commit is contained in:
Abubakar Abid 2022-03-22 10:26:59 -07:00 committed by GitHub
commit f97cbbd0d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,8 +11,9 @@ if TYPE_CHECKING: # Only import for type checking (is False at runtime).
class Block:
def __init__(self):
def __init__(self, css=None):
self._id = Context.id
self.css = css
Context.id += 1
if Context.block is not None:
Context.block.children.append(self)