@@ -446,8 +446,9 @@ def step(self, value):
446446 minimum = 0 )
447447
448448 @property
449- def style (self ) -> Optional [str ]:
450- """CSS styling to apply to the axis label. Defaults to :obj:`None <python:None>`.
449+ def style (self ) -> Optional [str | dict ]:
450+ """CSS styling to apply to the axis label. Defaults to
451+ :obj:`None <python:None>`.
451452
452453 .. hint::
453454
@@ -457,15 +458,19 @@ def style(self) -> Optional[str]:
457458
458459 Use ``"textOverflow: 'one'"`` to prevent ellipsis (three dots).
459460
460- :rtype: :class:`str` or :obj:`None <python:None>`
461+ :rtype: :class:`str <python:str>` or :class:`dict <python:dict>` or
462+ :obj:`None <python:None>`
461463 """
462464 return self ._style
463465
464466 @style .setter
465467 def style (self , value ):
466- self ._style = validators .string (value ,
467- allow_empty = True ,
468- coerce_value = True )
468+ try :
469+ self ._style = validators .dict (value , allow_empty = True )
470+ except (ValueError , TypeError ):
471+ self ._style = validators .string (value ,
472+ allow_empty = True ,
473+ coerce_value = True )
469474
470475 @property
471476 def use_html (self ) -> Optional [bool ]:
@@ -653,7 +658,7 @@ def rotation(self, value):
653658 minimum = 0 )
654659
655660 @property
656- def style (self ) -> Optional [str ]:
661+ def style (self ) -> Optional [str | dict ]:
657662 """CSS styling to apply to the label. Defaults to :obj:`None <python:None>`.
658663
659664 :rtype: :class:`str` or :obj:`None <python:None>`
@@ -662,9 +667,12 @@ def style(self) -> Optional[str]:
662667
663668 @style .setter
664669 def style (self , value ):
665- self ._style = validators .string (value ,
666- allow_empty = True ,
667- coerce_value = True )
670+ try :
671+ self ._style = validators .dict (value , allow_empty = True )
672+ except (ValueError , TypeError ):
673+ self ._style = validators .string (value ,
674+ allow_empty = True ,
675+ coerce_value = True )
668676
669677 @property
670678 def text (self ) -> Optional [str ]:
0 commit comments