From 056fc4f45c3ed2dedc7efccd77d7def0ed39550d Mon Sep 17 00:00:00 2001 From: Edan Bainglass Date: Sat, 11 Jan 2025 06:28:22 +0000 Subject: [PATCH] Tag structure manager and viewer with CSS classes for easy styling --- aiidalab_widgets_base/structures.py | 2 ++ aiidalab_widgets_base/viewers.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/aiidalab_widgets_base/structures.py b/aiidalab_widgets_base/structures.py index 4a0ee2d0..ef63cfc2 100644 --- a/aiidalab_widgets_base/structures.py +++ b/aiidalab_widgets_base/structures.py @@ -137,6 +137,8 @@ def __init__( super().__init__(children=[*children, self.output], **kwargs) + self.add_class("structure-manager") + def _structure_importers(self, importers): """Preparing structure importers.""" if not isinstance(importers, (list, tuple)): diff --git a/aiidalab_widgets_base/viewers.py b/aiidalab_widgets_base/viewers.py index bdcb9260..c6375bc0 100644 --- a/aiidalab_widgets_base/viewers.py +++ b/aiidalab_widgets_base/viewers.py @@ -311,6 +311,7 @@ def __init__( self._viewer.stage.set_parameters(mouse_preset="pymol") view_box = ipw.VBox([self._viewer]) + view_box.add_class("view-box") configuration_tabs_map = { "Cell": self._cell_tab(), @@ -1150,6 +1151,7 @@ class StructureDataViewer(_StructureDataBaseViewer): def __init__(self, structure=None, **kwargs): super().__init__(**kwargs) + self.add_class("structure-viewer") self.structure = structure @tl.observe("supercell")