class_docstr: A callable for converting CSS declarations to ExcelWriter styles
  
  Supports parts of CSS 2.2, with minimal CSS 3.0 support (e.g. text-shadow),
  focusing on font styling, backgrounds, borders and alignment.
  
  Operates by first computing CSS styles in a fairly generic
  way (see :meth:`compute_css`) then determining Excel style
  properties from CSS properties (see :meth:`build_xlstyle`).
  
  Parameters
  ----------
  inherited : str, optional
      CSS declarations understood to be the containing scope for the
      CSS processed by :meth:`__call__`.
class_docstr_tok: ["A","callable","for","converting","CSS","declarations","to","ExcelWriter","styles","Supports","parts","of","CSS","2.2",",","with","minimal","CSS","3.0","support","(","e.g",".","text-shadow",")",",","focusing","on","font","styling",",","backgrounds",",","borders","and","alignment",".","Operates","by","first","computing","CSS","styles","in","a","fairly","generic","way","(","see",":","meth",":","`","compute_css","`",")","then","determining","Excel","style","properties","from","CSS","properties","(","see",":","meth",":","`","build_xlstyle","`",")",".","Parameters","--","--","--","--","--","inherited",":","str",",","optional","CSS","declarations","understood","to","be","the","containing","scope","for","the","CSS","processed","by",":","meth",":","`","__call__","`","."]
code: def build_xlstyle(
      self, props: Mapping[str, str]
  ) -> dict[str, dict[str, str]]:
      out = {
          "alignment": self.build_alignment(props),
          "border": self.build_border(props),
          "fill": self.build_fill(props),
          "font": self.build_font(props),
          "number_format": self.build_number_format(props),
      }
  
      # TODO: handle cell width and height: needs support in pandas.io.excel
  
      def remove_none(d: dict[str, str | None]) -> None:
          """Remove key where value is None, through nested dicts"""
          for k, v in list(d.items()):
              if v is None:
                  del d[k]
              elif isinstance(v, dict):
                  remove_none(v)
                  if not v:
                      del d[k]
  
      remove_none(out)
      return out
  
imports: from __future__ import annotations
  from collections.abc import Hashable, Iterable, Mapping, Sequence
  import functools
  import itertools
  import re
  from typing import TYPE_CHECKING, Any, Callable, cast
  import warnings
  import numpy
  from pandas._libs.lib import is_list_like
  from pandas.util._decorators import doc
  from pandas.util._exceptions import find_stack_level
  from pandas.core.dtypes import missing
  from pandas.core.dtypes.common import is_float, is_scalar
  from pandas import DataFrame, Index, MultiIndex, PeriodIndex
  import pandas.core.common
  from pandas.core.shared_docs import _shared_docs
  from pandas.io.formats._color_data import CSS4_COLORS
  from pandas.io.formats.css import CSSResolver, CSSWarning
  from pandas.io.formats.format import get_level_lengths
  from pandas.io.formats.printing import pprint_thing
label_desc: Use image node_id 4 for calling the CSSToExcelConverter obj's underlying member method code with example usage: obj.build_xlstyle(props) and returns: out