当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript styleHelpers.allButtonStates函数代码示例

本文整理汇总了TypeScript中@library/styles/styleHelpers.allButtonStates函数的典型用法代码示例。如果您正苦于以下问题:TypeScript allButtonStates函数的具体用法?TypeScript allButtonStates怎么用?TypeScript allButtonStates使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了allButtonStates函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: unit

 const iconMixin = (dimension: number): NestedCSSProperties => ({
     ...buttonResetMixin(),
     alignItems: "center",
     display: "flex",
     height: unit(dimension),
     minWidth: unit(dimension),
     width: unit(dimension),
     justifyContent: "center",
     border: "none",
     padding: 0,
     ...allButtonStates({
         hover: {
             color: colorOut(globalVars.mainColors.primary),
         },
         focusNotKeyboard: {
             outline: 0,
             color: colorOut(globalVars.mainColors.secondary),
         },
         focus: {
             color: colorOut(globalVars.mainColors.secondary),
         },
         accessibleFocus: {
             color: colorOut(globalVars.mainColors.secondary),
         },
         active: {
             color: colorOut(globalVars.mainColors.secondary),
         },
     }),
 });
开发者ID:vanilla,项目名称:vanilla,代码行数:29,代码来源:buttonStyles.ts

示例2: useThemeCache


//.........这里部分代码省略.........
        {
            color: vars.colors.fg.toString(),
            padding: `0 ${px(vars.sizing.spacer / 2)}`,
            margin: `0 ${px(vars.sizing.spacer / 2)}`,
            borderRadius: px(vars.button.borderRadius),
        },
        mediaQueries.oneColumnDown({
            fontSize: px(vars.button.mobile.fontSize),
        }),
    );

    const localeToggle = style(
        "localeToggle",
        {
            height: px(vars.sizing.height),
        },
        mediaQueries.oneColumnDown({
            height: px(vars.sizing.mobile.height),
        }),
    );

    const languages = style("languages", {
        marginLeft: "auto",
    });

    const button = style(
        "button",
        {
            color: vars.colors.fg.toString(),
            height: px(vars.sizing.height),
            minWidth: px(vars.button.size),
            maxWidth: percent(100),
            padding: px(0),
            ...allButtonStates(
                {
                    active: {
                        // color: vars.colors.fg.toString(),
                        $nest: {
                            "& .meBox-buttonContent": {
                                backgroundColor: colorOut(vars.buttonContents.state.bg),
                            },
                        },
                    },
                    hover: {
                        // color: vars.colors.fg.toString(),
                        $nest: {
                            "& .meBox-buttonContent": {
                                backgroundColor: colorOut(vars.buttonContents.state.bg),
                            },
                        },
                    },
                    accessibleFocus: {
                        outline: 0,
                        $nest: {
                            "& .meBox-buttonContent": {
                                borderColor: colorOut(vars.colors.fg),
                                backgroundColor: colorOut(vars.buttonContents.state.bg),
                            },
                        },
                    },
                },
                {
                    "& .meBox-buttonContent": {
                        ...borders({
                            width: 1,
                            color: "transparent",
开发者ID:vanilla,项目名称:vanilla,代码行数:67,代码来源:titleBarStyles.ts

示例3: useThemeCache

export const messagesClasses = useThemeCache(() => {
    const vars = messagesVariables();
    const globalVars = globalVariables();
    const style = styleFactory("messages");
    const titleBarVars = titleBarVariables();
    const shadows = shadowHelper();
    const mediaQueries = layoutVariables().mediaQueries();

    // Fixed wrapper
    const fixed = style("fixed", {
        position: "fixed",
        left: 0,
        top: unit(titleBarVars.sizing.height - 8),
        minHeight: unit(vars.sizing.minHeight),
        width: percent(100),
        maxWidth: viewWidth(100),
        zIndex: 20,
    });

    const root = style(
        {
            width: percent(100),
        },
        margins({ horizontal: "auto" }),
    );

    const wrap = style(
        "wrap",
        {
            display: "flex",
            alignItems: "center",
            justifyContent: "flex-start",
            minHeight: unit(vars.sizing.minHeight),
            backgroundColor: colorOut(vars.colors.bg),
            width: percent(100),
            ...shadowOrBorderBasedOnLightness(
                globalVars.body.backgroundImage.color,
                borders({
                    color: globalVars.mainColors.fg,
                }),
                shadows.embed(),
            ),
            margin: "auto",
            color: colorOut(vars.colors.fg),
            ...paddings({
                ...vars.spacing.padding,
                right: vars.spacing.padding.horizontal / 2,
            }),
        },
        mediaQueries.xs({
            flexWrap: "wrap",
            paddingLeft: unit(vars.spacing.padding.horizontal / 2),
        }),
    );

    const message = style("message", {
        ...userSelect(),
        ...fonts(vars.text.font),
        flex: 1,
    });

    const setWidth = style("setWidth", {
        width: unit(vars.sizing.width),
        maxWidth: percent(100),
    });

    const actionButton = style(
        "actionButton",
        {
            ...paddings(vars.actionButton.padding),
            minHeight: unit(vars.actionButton.minHeight),
            whiteSpace: "nowrap",
            ...fonts(vars.actionButton.font),
            ...allButtonStates({
                noState: {
                    color: colorOut(vars.colors.fg),
                },
                allStates: {
                    color: colorOut(vars.colors.states.fg),
                },
                focusNotKeyboard: {
                    outline: 0,
                },
            }),
        },
        mediaQueries.xs({
            padding: 0,
            width: percent(100),
            textAlign: "center",
        }),
    );

    return {
        root,
        wrap,
        actionButton,
        message,
        fixed,
        setWidth,
    };
//.........这里部分代码省略.........
开发者ID:vanilla,项目名称:vanilla,代码行数:101,代码来源:messageStyles.ts


注:本文中的@library/styles/styleHelpers.allButtonStates函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。