Instance of |StylesPart| for this document. Creates an empty styles part if one is not present.
(self)
| 155 | |
| 156 | @property |
| 157 | def _styles_part(self) -> StylesPart: |
| 158 | """Instance of |StylesPart| for this document. |
| 159 | |
| 160 | Creates an empty styles part if one is not present. |
| 161 | """ |
| 162 | try: |
| 163 | return cast(StylesPart, self.part_related_by(RT.STYLES)) |
| 164 | except KeyError: |
| 165 | package = self.package |
| 166 | assert package is not None |
| 167 | styles_part = StylesPart.default(package) |
| 168 | self.relate_to(styles_part, RT.STYLES) |
| 169 | return styles_part |
nothing calls this directly
no test coverage detected