本文整理汇总了TypeScript中csx.quote函数的典型用法代码示例。如果您正苦于以下问题:TypeScript quote函数的具体用法?TypeScript quote怎么用?TypeScript quote使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了quote函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: gradient
export const addGradientsToHintOverflow = (width: number | string, color: ColorHelper) => {
const gradient = (direction: "right" | "left") => {
return `linear-gradient(to ${direction}, ${colorOut(color.fade(0))} 0%, ${colorOut(
color.fade(0.3),
)} 20%, ${colorOut(color)} 90%)`;
};
return {
$nest: {
"&:after": {
...absolutePosition.topRight(),
background: gradient("right"),
},
"&:before": {
...absolutePosition.topLeft(),
background: gradient("left"),
},
"&:before, &:after": {
...pointerEvents(),
content: quote(``),
height: percent(100),
width: unit(width),
zIndex: 1,
},
},
};
};
示例2: debugHelper
export const spinnerLoader = (props: ISpinnerProps) => {
const debug = debugHelper("spinnerLoader");
const globalVars = globalVariables();
const spinnerVars = {
color: props.color || globalVars.mainColors.primary,
size: props.size || 18,
thickness: props.thickness || 3,
speed: "0.7s",
...props,
};
return {
...debug.name("spinner"),
position: "relative" as PositionProperty,
content: quote("") as ContentProperty,
...defaultTransition("opacity"),
display: "block" as DisplayProperty,
width: unit(spinnerVars.size),
height: unit(spinnerVars.size),
borderRadius: percent(50),
borderTop: `${unit(spinnerVars.thickness)} solid ${spinnerVars.color.toString()}`,
borderRight: `${unit(spinnerVars.thickness)} solid ${spinnerVars.color.fade(0.3).toString()}`,
borderBottom: `${unit(spinnerVars.thickness)} solid ${spinnerVars.color.fade(0.3).toString()}`,
borderLeft: `${unit(spinnerVars.thickness)} solid ${spinnerVars.color.fade(0.3).toString()}`,
transform: "translateZ(0)",
animation: `spillerLoader ${spinnerVars.speed} infinite ease-in-out`,
animationName: spinnerLoaderAnimation,
animationDuration: spinnerVars.speed,
animationIterationCount: "infinite",
animationTimingFunction: "ease-in-out",
};
};
示例3: fakeBackgroundFixed
export function fakeBackgroundFixed() {
return {
content: quote(""),
display: "block",
position: "fixed",
top: px(0),
left: px(0),
width: viewWidth(100),
height: viewHeight(100),
};
}
示例4: titleBarNavClasses
export default function titleBarNavClasses() {
const globalVars = globalVariables();
const titleBarVars = titleBarVariables();
const vars = titleBarNavigationVariables();
const mediaQueries = layoutVariables().mediaQueries();
const flex = flexHelper();
const style = styleFactory("titleBarNav");
const root = style(
{
...flex.middleLeft(),
position: "relative",
height: unit(titleBarVars.sizing.height),
},
mediaQueries.oneColumnDown({
height: unit(titleBarVars.sizing.mobile.height),
}),
);
const navigation = style("navigation", {});
const items = style(
"items",
{
...flex.middleLeft(),
height: unit(titleBarVars.sizing.height),
...paddings(vars.padding),
},
mediaQueries.oneColumnDown({
height: px(titleBarVars.sizing.mobile.height),
justifyContent: "center",
width: percent(100),
}),
);
const link = style("link", {
...userSelect(),
color: colorOut(titleBarVars.colors.fg),
whiteSpace: "nowrap",
lineHeight: globalVars.lineHeights.condensed,
display: "flex",
alignItems: "center",
justifyContent: "center",
height: unit(vars.item.size),
textDecoration: "none",
$nest: {
"&.focus-visible": {
backgroundColor: colorOut(titleBarVars.buttonContents.state.bg),
},
"&:focus": {
backgroundColor: colorOut(titleBarVars.buttonContents.state.bg),
},
"&:hover": {
backgroundColor: colorOut(titleBarVars.buttonContents.state.bg),
},
},
});
const linkActive = style("linkActive", {
$nest: {
"&:after": {
...absolutePosition.topLeft(
`calc(50% - ${unit(vars.linkActive.height + vars.linkActive.bottomSpace)})`,
),
content: quote(""),
height: unit(vars.linkActive.height),
marginLeft: unit(negative(vars.linkActive.offset)),
width: calc(`100% + ${unit(vars.linkActive.offset * 2)}`),
backgroundColor: colorOut(vars.linkActive.bg),
transform: `translateY(${unit(titleBarVars.sizing.height / 2)})`,
},
},
});
const linkContent = style("linkContent", {
position: "relative",
});
const firstItem = style("lastItem", {
zIndex: 2,
});
const lastItem = style("lastItem", {
zIndex: 2,
});
return {
root,
navigation,
items,
link,
linkActive,
linkContent,
lastItem,
firstItem,
};
}
示例5: useThemeCache
export const richEditorClasses = useThemeCache((legacyMode: boolean, mobile?: boolean) => {
const globalVars = globalVariables();
const style = styleFactory("richEditor");
const vars = richEditorVariables();
const formVars = formElementsVariables();
const root = style({
position: "relative",
display: "block",
$nest: {
"&.isDisabled": {
$nest: {
"&, &.richEditor-button": {
cursor: important("progress"),
},
},
},
"& .richEditor-text, & .richEditor-textWrap, & .richEditor-frame": {
display: "flex",
flexDirection: "column",
flexGrow: 1,
position: "relative",
},
"& .ql-clipboard": {
...srOnly(),
position: "fixed", // Fixed https://github.com/quilljs/quill/issues/1374#issuecomment-415333651
},
"& .richEditor-nextInput, .iconButton, .richEditor-button": {
...singleLineEllipsis(),
...appearance(),
position: "relative",
border: 0,
padding: 0,
background: "none",
textAlign: "left",
},
"& .Close-x": {
display: "block",
cursor: "pointer",
},
"& .content-wrapper": {
height: percent(100),
},
"& .embedDialogue": {
position: "relative",
},
},
});
const iconWrap = style("iconWrap", {
...pointerEvents(),
content: quote(``),
...absolutePosition.middleOfParent(),
width: unit(vars.iconWrap.width),
height: unit(vars.iconWrap.height),
...borders({
radius: 3,
color: "transparent",
}),
});
const paragraphMenu = style("paragraphMenu", {
position: "absolute",
display: "flex",
alignItems: "center",
justifyContent: "center",
top: unit(vars.pilcrow.offset),
left: 0,
marginLeft: unit(-globalVars.gutter.quarter + (!legacyMode ? -(globalVars.gutter.size + 6) : 0)),
transform: `translateX(-100%)`,
height: unit(vars.paragraphMenuHandle.size),
width: unit(globalVars.icon.sizes.default),
animationName: vars.pilcrow.animation.name,
animationDuration: vars.pilcrow.animation.duration,
animationTimingFunction: vars.pilcrow.animation.timing,
animationIterationCount: vars.pilcrow.animation.iterationCount,
zIndex: 1,
$nest: {
".richEditor-button&.isActive:hover": {
cursor: "default",
},
"&.isMenuInset": {
transform: "none",
},
},
});
const paragraphMenuMobile = style("paragraphMenu-mobile", {
position: "relative",
display: "flex",
alignItems: "center",
justifyContent: "center",
top: important(0),
});
const menuBar = style("menuBar", {
position: "relative",
width: unit(vars.menuButton.size * 4),
overflow: "hidden",
});
//.........这里部分代码省略.........
示例6: useThemeCache
//.........这里部分代码省略.........
color: vars.searchBar.border.leftColor,
},
radius: {
right: vars.searchButton.borderRadius,
left: 0,
},
}),
},
},
} as any);
const searchContainer = style("searchContainer", {
position: "relative",
maxWidth: percent(100),
width: px(vars.searchContainer.width),
margin: "auto",
$nest: {
".search-results": {
maxWidth: percent(100),
width: px(vars.searchContainer.width),
margin: "auto",
},
},
});
const icon = style("icon", {});
const input = style("input", {});
const buttonLoader = style("buttonLoader", {});
const titleAction = style("titleAction", {
// color: colorOut(vars.colors.fg),
});
const titleWrap = style("titleWrap", {
display: "flex",
flexWrap: "nowrap",
alignItems: "center",
width: unit(vars.searchContainer.width),
maxWidth: percent(100),
margin: "auto",
});
const titleFlexSpacer = style("titleFlexSpacer", {
position: "relative",
height: unit(formElementVars.sizing.height),
width: unit(formElementVars.sizing.height),
flexBasis: unit(formElementVars.sizing.height),
transform: translateX(px(formElementVars.sizing.height - globalVars.icon.sizes.default / 2 - 13)),
$nest: {
".searchBar-actionButton:after": {
content: quote(""),
...absolutePosition.middleOfParent(),
width: px(20),
height: px(20),
backgroundColor: colorOut(vars.shadow.background),
boxShadow: vars.shadow.full,
},
".searchBar-actionButton": {
color: important("inherit"),
$nest: {
"&:not(.focus-visible)": {
outline: 0,
},
},
},
".icon-compose": {
zIndex: 1,
},
},
});
const content = style("content", {
$nest: {
"&&.hasFocus .searchBar-valueContainer": {
borderColor: colorOut(vars.colors.contrast),
boxShadow: `0 0 0 ${unit(globalVars.border.width)} ${colorOut(vars.colors.primary)} inset`,
zIndex: 1,
},
},
});
return {
root,
outerBackground,
innerContainer,
title,
text,
icon,
buttonOverwrite,
searchButton,
searchContainer,
input,
buttonLoader,
titleAction,
titleFlexSpacer,
titleWrap,
content,
valueContainer,
};
});
示例7: useThemeCache
export const meBoxMessageClasses = useThemeCache(() => {
const globalVars = globalVariables();
const vars = meBoxMessageVariables();
const style = styleFactory("meBoxMessage");
const root = style({
display: "block",
$nest: {
"& + &": {
borderTop: `solid 1px ${colorOut(globalVars.border.color)}`,
},
},
});
const link = style("link", {
...userSelect(),
display: "flex",
flexWrap: "nowrap",
color: "inherit",
...paddings(vars.spacing.padding),
...buttonStates({
allStates: {
textShadow: "none",
},
hover: {
backgroundColor: colorOut(globalVars.states.hover.color),
},
focus: {
backgroundColor: colorOut(globalVars.states.focus.color),
},
active: {
backgroundColor: colorOut(globalVars.states.active.color),
},
}),
});
const imageContainer = style("imageContainer", {
position: "relative",
width: unit(vars.imageContainer.width),
height: unit(vars.imageContainer.width),
flexBasis: unit(vars.imageContainer.width),
borderRadius: percent(50),
overflow: "hidden",
border: `solid 1px ${globalVars.border.color.toString()}`,
});
const image = style("image", {
width: unit(vars.imageContainer.width),
height: unit(vars.imageContainer.width),
...objectFitWithFallback(),
});
const status = style("status", {
position: "relative",
width: unit(vars.unreadDot.width),
flexBasis: unit(vars.unreadDot.width),
$nest: {
"&.isUnread": {
$nest: {
"&:after": {
...absolutePosition.middleRightOfParent(),
content: quote(""),
height: unit(vars.unreadDot.width),
width: unit(vars.unreadDot.width),
backgroundColor: globalVars.mainColors.primary.toString(),
borderRadius: percent(50),
},
},
},
},
});
const contents = style("contents", {
flexGrow: 1,
...paddings({
left: vars.spacing.padding.left,
right: vars.spacing.padding.right,
}),
maxWidth: calc(`100% - ${unit(vars.unreadDot.width + vars.imageContainer.width)}`),
});
const message = style("message", {
lineHeight: globalVars.lineHeights.excerpt,
color: colorOut(globalVars.mainColors.fg),
});
return { root, link, imageContainer, image, status, contents, message };
});