本文整理汇总了TypeScript中csx.important函数的典型用法代码示例。如果您正苦于以下问题:TypeScript important函数的具体用法?TypeScript important怎么用?TypeScript important使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了important函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: useThemeCache
export const insertLinkClasses = useThemeCache(() => {
const vars = richEditorVariables();
const style = styleFactory("insertLink");
const root = style({
position: "relative",
display: "flex",
flexWrap: "nowrap",
alignItems: "center",
maxWidth: unit(vars.insertLink.width),
width: percent(100),
paddingLeft: 0,
});
const input = style("input", {
zIndex: 2,
$nest: {
"&, &.InputBox": {
border: important("0"),
marginBottom: important("0"),
flexGrow: 1,
maxWidth: calc(`100% - ${unit(vars.menuButton.size)}`),
},
},
});
return { root, input };
});
示例2: formElementsVariables
export const disabledInput = () => {
const formElementVars = formElementsVariables();
return {
pointerEvents: important("none"),
...userSelect("none", true),
cursor: important("default"),
opacity: important((formElementVars.disabled.opacity as any).toString()),
};
};
示例3: useThemeCache
export const frameFooterClasses = useThemeCache(() => {
const globalVars = globalVariables();
const style = styleFactory("frameFooter");
const vars = frameVariables();
const root = style({
display: "flex",
minHeight: unit(vars.footer.minHeight),
alignItems: "center",
position: "relative",
zIndex: 1,
borderTop: singleBorder(),
flexWrap: "wrap",
justifyContent: "space-between",
...paddings({
top: 0,
bottom: 0,
left: vars.footer.spacing,
right: vars.footer.spacing,
}),
});
const justifiedRight = style("justifiedRight", {
$nest: {
"&&": {
justifyContent: "flex-end",
},
},
});
const markRead = style("markRead", {
$nest: {
"&.buttonAsText": {
fontWeight: globalVars.fonts.weights.semiBold,
color: colorOut(globalVars.mainColors.primary),
},
},
});
const actionButton = style("actionButton", {
marginLeft: unit(24),
});
const selfPadded = style({
paddingLeft: important(0),
paddingRight: important(0),
});
return { root, markRead, selfPadded, actionButton, justifiedRight };
});
示例4: srOnly
export function srOnly() {
return {
position: important("absolute"),
display: important("block"),
width: important(px(1).toString()),
height: important(px(1).toString()),
padding: important(px(0).toString()),
margin: important(px(-1).toString()),
overflow: important("hidden"),
clip: important(`rect(0, 0, 0, 0)`),
border: important(px(0).toString()),
};
}
示例5: important
export const appearance = (value: AppearanceProperty = "none", isImportant: boolean = false) => {
const val = (isImportant ? important(value) : value) as any;
return {
"-webkit-appearance": val,
"-moz-appearance": val,
appearance: val,
};
};
示例6: useThemeCache
export const richEditorFlyoutClasses = useThemeCache(() => {
const vars = richEditorVariables();
const style = styleFactory("richEditorFlyout");
const shadows = shadowHelper();
const globalVars = globalVariables();
const root = style({
...shadows.dropDown(),
position: "absolute",
left: 0,
width: unit( vars.richEditorWidth + vars.emojiBody.padding.horizontal * 2),
zIndex: 6,
overflow: "hidden",
backgroundColor: colorOut(vars.colors.bg),
...borders(),
$nest: {
"&& .ReactVirtualized__Grid": {
width: important(unit(vars.richEditorWidth) as string),
},
},
});
const header = style("header", {
position: "relative",
borderBottom: singleBorder(),
...paddings(vars.emojiHeader.padding),
});
const title = style("title", {
display: "flex",
alignItems: "center",
...longWordEllipsis(),
margin: 0,
maxWidth: calc(`100% - ${unit(vars.menuButton.size)}`),
minHeight: vars.menuButton.size - vars.emojiBody.padding.horizontal,
fontSize: percent(100),
lineHeight: "inherit",
color: colorOut(globalVars.mainColors.fg),
$nest: {
"&:focus": {
outline: 0,
},
},
});
const body = style("body", {
...paddings(vars.emojiBody.padding),
width: unit( vars.richEditorWidth + vars.emojiBody.padding.horizontal * 2),
});
const footer = style("footer", {
borderTop: singleBorder(),
});
return { root, header, body, footer, title };
});
示例7: useThemeCache
export const buttonUtilityClasses = useThemeCache(() => {
const vars = buttonGlobalVariables();
const globalVars = globalVariables();
const formElementVars = formElementsVariables();
const style = styleFactory("buttonUtils");
const pushLeft = style("pushLeft", {
marginRight: important("auto"),
});
const pushRight = style("pushRight", {
marginLeft: important("auto"),
});
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),
},
}),
});
const buttonIcon = style("icon", iconMixin(formElementVars.sizing.height));
const buttonIconCompact = style("iconCompact", iconMixin(vars.sizing.compactHeight));
const asTextStyles: NestedCSSProperties = {
...buttonResetMixin(),
minWidth: important(0),
padding: 0,
overflow: "hidden",
textAlign: "left",
lineHeight: globalVars.lineHeights.base,
fontWeight: globalVars.fonts.weights.semiBold,
};
const buttonAsText = style("asText", asTextStyles, {
color: "inherit",
$nest: {
"&:not(.focus-visible)": {
outline: 0,
},
"&:hover": {
color: colorOut(globalVars.mainColors.primary),
},
"&:focus, &:active": {
color: colorOut(globalVars.mainColors.secondary),
},
},
});
const buttonAsTextPrimary = style("asTextPrimary", asTextStyles, {
color: colorOut(globalVars.mainColors.primary),
$nest: {
"&:not(.focus-visible)": {
outline: 0,
},
"&:hover, &:focus, &:active": {
color: colorOut(globalVars.mainColors.secondary),
},
},
});
return {
pushLeft,
buttonAsText,
buttonAsTextPrimary,
pushRight,
buttonIconCompact,
buttonIcon,
};
});
示例8: style
import { important } from 'csx';
import { style } from 'typestyle';
export const settingsForm = style({
$debugName: 'settingsForm',
$nest: {
'.form-group:last-of-type': {
marginBottom: 0
}
}
});
export const checkbox = style({
justifyContent: important('flex-start')
});