
    BPc                     4    d Z ddlZddlZ G d d          ZdS )zToplevel CSS utils that do not depend on other inkex functionality

.. versionadded:: 1.2
    Previously a part of :py:mod:`inkex.styles`    Nc                   P    e Zd ZdZ ej        d          dfgZd Zd Zd Z	d Z
dS )	ConditionalRulezeA single css rule

    .. versionchanged:: 1.2
        The CSS rule is now processed using cssselect.z(::|\/)([a-z]+)(?=\W)(?!-)z\1svg:\2c                     |                                 | _        t          j        | j                  d         | _        d S )Nr   )striprule	cssselectparseselector)selfr   s     +/usr/share/inkscape/extensions/inkex/css.py__init__zConditionalRule.__init__)   s-    JJLL	!	2215    c                     | j         S )N)r   r   s    r   __str__zConditionalRule.__str__-   s
    yr   c                     t          j                                        | j                  dz   }| j        D ]\  }}|                    ||          }|                                S )z3Attempt to convert the rule into a simplified xpath )r   HTMLTranslatorselector_to_xpathr
   step_to_xpathsubr   )r   retmatcherreplacers       r   to_xpathzConditionalRule.to_xpath0   sa     &((::4=IICO!%!3 	- 	-GX++h,,CCyy{{r   c                 4    | j                                         S )zHgets the css specificity of this selector

        .. versionadded:: 1.2)r
   specificityr   s    r   get_specificityzConditionalRule.get_specificity9   s     }((***r   N)__name__
__module____qualname____doc__recompiler   r   r   r   r    r   r   r   r      sx        : : 
1	2	2K@M
6 6 6    + + + + +r   r   )r"   r#   r   r   r%   r   r   <module>r&      sX   (3 3 
			    + + + + + + + + + +r   