Esempio n. 1
0
    def render_css_global(cls, context):
        colors = context.styles.colors

        _target = "&:hover, &:target, &.focus-within"
        _focus = "&:hover, &:focus, &.focus-within"

        return CssDict({
            comment(): f"<{cls.__module__}.{cls.__name__}>",
            ".prop_types": {
                _target: {
                    background: colors[3],
                },
                "&-doc-part, &-props .value": {
                    _focus: {
                        background: colors[4],
                    },
                },
                "&-props-doc-part .value": {
                    _focus: {
                        background: colors[5],
                    }
                }
            },
            comment(): f"</{cls.__module__}.{cls.__name__}>",
        })
Esempio n. 2
0
 def render_css_global(cls, context):
     return CssDict({
         comment(): f"<{cls.__module__}.{cls.__name__}>",
         ".HtmlUtils .function-function > summary > .h:after": extend('TAG', 'HL',
             css={
                 content: str("function"),
             }
         ),
         comment(): f"</{cls.__module__}.{cls.__name__}>",
     })
Esempio n. 3
0
 def render_css_global(cls, context):
     return CssDict({
         comment(): f"<{cls.__module__}.{cls.__name__}>",
         ".doc-part": {
             padding: (5*px, 0, 5*px, 5*px),
             border-radius: (7*px, 0, 0, 7*px),
             -moz-outline-radius: (7*px, 0, 0, 7*px),
             -webkit-outline-radius: (7*px, 0, 0, 7*px),
             outline-radius: (7*px, 0, 0, 7*px),
             "&[open] > summary > .h": {
                 text-decoration: underline
             }
         },
         comment(): f"</{cls.__module__}.{cls.__name__}>",
     })
Esempio n. 4
0
 def render_css_global(cls, context):
     return CssDict({
         comment(): f"<{cls.__module__}.{cls.__name__}>",
         ".value": {
             "&:not(:last-child) p:last-child": {
                 margin-bottom: 0,
             },
             "&:not(:first-child)": {
                 margin-top: 1*em,
             },
             ".docstring": {
                 margin-left: 1*em,
             },
         },
         comment(): f"</{cls.__module__}.{cls.__name__}>",
     })
Esempio n. 5
0
 def render_css_global(cls, context):
     return CssDict({
         comment(): f"<{cls.__module__}.{cls.__name__}>",
         "details.docstring": {
             margin-top: 1*em,
             "> summary > p": {
                 margin-top: 0,
                 white-space: normal,
                 display: inline,
             },
             "> div.content > p:first-child": {
                 margin-top: 1*em,
             },
         },
         comment(): f"</{cls.__module__}.{cls.__name__}>",
     })
Esempio n. 6
0
File: base.py Progetto: twidi/mixt
    def render_css_global(cls, context):
        colors = context.styles.colors

        _target = "&:hover, &:target, &.focus-within"
        _focus = "&:hover, &:focus, &.focus-within"

        return CssDict({
            comment(): f"<{cls.__module__}.{cls.__name__}>",
            ".doc > .manual:first-child:last-child": {
                padding: (5 * px, 0, 5 * px, 1 * em),
                border - radius: (7 * px, 0, 0, 7 * px),
            },
            ".manual": {
                "> .content": {
                    "> p:first-child": {
                        margin - top: 1 * em,
                        strong: {
                            line - height: 1.3,
                        }
                    }
                },
                _target: {
                    background: colors[2]
                },
                ".doc-part": {
                    _focus: {
                        background: colors[3]
                    },
                    ".doc-part": {
                        _focus: {
                            background: colors[4]
                        },
                        ".doc-part": {
                            _focus: {
                                background: colors[5]
                            },
                            ".doc-part": {
                                _focus: {
                                    background: colors[6]
                                },
                            }
                        }
                    }
                },
            },
            comment(): f"</{cls.__module__}.{cls.__name__}>",
        })
Esempio n. 7
0
 def render_css_global(cls, context):
     return CssDict({
         comment(): f"<{cls.__module__}.{cls.__name__}>",
         raw(): HtmlFormatter().get_style_defs(".code"),
         ".code": {
             display: block,
             background: transparent,
             margin - top: 5 * px,
             "> pre": {
                 display: inline - block,
                 margin: 0,
                 overflow: auto,
                 white - space: pre,
             }
         },
         comment(): f"</{cls.__module__}.{cls.__name__}>",
     })
Esempio n. 8
0
    def render_css_global(cls, context):
        if cls is _BaseContainer:
            return None

        colors = context.styles.colors

        _kind = cls.__kind__
        _functions_kind = cls.__functions_kind__
        _target = "&:hover, &:target, &.focus-within"
        _focus = "&:hover, &:focus, &.focus-within"

        return CssDict({
            comment(): f"<{cls.__module__}.BaseContainer.{cls.__name__}>",
            f".{_kind}": {
                "> summary > .h:after": extend('TAG', 'HL',
                    css={
                        content: str(_kind),
                    }
                ),
                _target: {
                    background: colors[2],
                },
                "&-doc-part": {
                    _focus: {
                        background: colors[3],
                    }
                },
                f"&-attributes .value, &-{_functions_kind} .function": {
                    _focus: {
                        background: colors[4],
                    }
                },
                f"&-{_functions_kind} .function-doc-part": {
                    _focus: {
                        background: colors[5],
                    }
                },
                f"&-{_functions_kind} .value": {
                    _focus: {
                        background: colors[6],
                    }
                },
            },
            comment(): f"</{cls.__module__}.BaseContainer.{cls.__name__}>",
        })
Esempio n. 9
0
    def render_css_global(cls, context):
        _focus = "&:hover, &:focus, &.focus-within"

        return CssDict({
            comment(): f"<{cls.__module__}.{cls.__name__}>",
            ".h": {
                "+ .permalink": {
                    visibility: hidden,
                    padding-left: 0.5*em,
                    vertical-align: middle,
                    line-height: 0.8,
                    color: '#333',
                    opacity: 0.75,
                    _focus: {
                        visibility: visible,
                    }
                },
                _focus: {
                    "+ .permalink": {
                        visibility: visible,
                    },
                },
            },
            div: {
                _focus: {
                    "> .h + .permalink": {
                        visibility: visible,
                    }
                }
            },
            details: {
                _focus: {
                    "> summary > .h + .permalink": {
                        visibility: visible,
                    }
                }
            },
            comment(): f"</{cls.__module__}.{cls.__name__}>",
        })
Esempio n. 10
0
 def render_css_global(cls, context):
     return CssDict({
         ".bar": extend(extends["ext"], css={
             "color": "BAR",
         })
     })
Esempio n. 11
0
 def render_css_global(cls, context):
     return CssDict({
         ".foo": extend("ext", css={
             "color": "FOO",
         })
     })
Esempio n. 12
0
 def render_css_global(cls, context):
     return CssDict({
         "%ext": {"ext": "end"}
     })
Esempio n. 13
0
 def render_css_global(cls, context):
     return CssDict({
         comment(): f"<{cls.__module__}.{cls.__name__}>",
         details: {
             ".h": {
                 margin - top: 0,
                 padding: (3 * px, 0),
                 margin - bottom: 0,
             },
             "&[open]": {
                 ".h": {
                     margin - bottom: 1 * em,
                 }
             },
             ".h:last-child": {
                 margin - bottom: 0,
             },
             "details + &, summary + &": {
                 margin - top: 1 * em,
             },
             "> :not(summary)": {
                 margin - left: 1 * em,
                 media({max - width: context.styles.breakpoint}): {
                     margin - left: 0.2 * em,
                 }
             },
             "> div.content": {
                 border - left: (solid, rgba(0, 0, 0, 0.1), 1 * px),
                 margin - left: 4 * px,
                 padding: (5 * px, 0, 5 * px, 1 * em),
                 (" > :first-child" * nb for nb in b.range(1, 7)): {
                     margin - top: 0,
                 },
                 "> p:last-child": {
                     margin - top: 0,
                 },
                 media({max - width: context.styles.breakpoint}): {
                     margin - left: 3 * px,
                     padding - left: 0.2 * em,
                 }
             },
         },
         summary: {
             cursor: pointer,
             white - space: nowrap,
             ".h": {
                 display: inline - block,
                 vertical - align: middle,
                 line - height: 1.3,
                 white - space: normal,
             },
         },
         ".h + details": {
             margin - top: 1 * em,
         },
         "&:hover, &:focus, &.focus-within": {
             "> div.content": {
                 border - left: (solid, transparent, 1 * px),
             }
         },
         comment(): f"</{cls.__module__}.{cls.__name__}>",
     })