react-cascading-style-sheets
Version:
Package used to integrate CSS onto javascript.
417 lines (413 loc) • 7.85 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var index_exports = {};
__export(index_exports, {
CascadingStyleSheet: () => CascadingStyleSheet,
styling: () => styling
});
module.exports = __toCommonJS(index_exports);
// src/functions/CascadingStyleSheet.ts
var CascadingStyleSheet = class {
accentColor;
alignContent;
alignItems;
alignSelf;
all;
animation;
animationDelay;
animationDirection;
animationDuration;
animationFillMode;
animationIterationCount;
animationName;
animationPlayState;
animationTimingFunction;
aspectRatio;
backdropFilter;
backfaceVisibility;
background;
backgroundAttachment;
backgroundBlendMode;
backgroundClip;
backgroundColor;
backgroundImage;
backgroundOrigin;
backgroundPosition;
backgroundPositionX;
backgroundPositionY;
backgroundRepeat;
backgroundSize;
blockSize;
border;
borderBlock;
borderBlockColor;
borderBlockEnd;
borderBlockEndColor;
borderBlockEndStyle;
borderBlockEndWidth;
borderBlockStart;
borderBlockStartColor;
borderBlockStartStyle;
borderBlockStartWidth;
borderBlockStyle;
borderBlockWidth;
borderBottom;
borderBottomColor;
borderBottomLeftRadius;
borderBottomRightRadius;
borderBottomStyle;
borderBottomWidth;
borderCollapse;
borderColor;
borderEndEndRadius;
borderEndStartRadius;
borderImage;
borderImageOutset;
borderImageRepeat;
borderImageSlice;
borderImageSource;
borderImageWidth;
borderInline;
borderInlineColor;
borderInlineEnd;
borderInlineEndColor;
borderInlineEndStyle;
borderInlineEndWidth;
borderInlineStart;
borderInlineStartColor;
borderInlineStartStyle;
borderInlineStartWidth;
borderInlineStyle;
borderInlineWidth;
borderLeft;
borderLeftColor;
borderLeftStyle;
borderLeftWidth;
borderRadius;
borderRight;
borderRightColor;
borderRightStyle;
borderRightWidth;
borderSpacing;
borderStartEndRadius;
borderStartStartRadius;
borderStyle;
borderTop;
borderTopColor;
borderTopLeftRadius;
borderTopRightRadius;
borderTopStyle;
borderTopWidth;
borderWidth;
bottom;
boxDecorationBreak;
boxReflect;
boxShadow;
boxSizing;
breakAfter;
breakBefore;
breakInside;
captionSide;
caretColor;
clear;
clip;
clipPath;
color;
colorScheme;
columnCount;
columnFill;
columnGap;
columnRule;
columnRuleColor;
columnRuleStyle;
columnRuleWidth;
columnSpan;
columnWidth;
columns;
content;
counterIncrement;
counterReset;
counterSet;
cursor;
direction;
display;
emptyCells;
filter;
flex;
flexBasis;
flexDirection;
flexFlow;
flexGrow;
flexShrink;
flexWrap;
float;
font;
fontFamily;
fontFeatureSettings;
fontKerning;
fontLanguageOverride;
fontSize;
fontSizeAdjust;
fontStretch;
fontStyle;
fontSynthesis;
fontVariant;
fontVariantAlternates;
fontVariantCaps;
fontVariantEastAsian;
fontVariantLigatures;
fontVariantNumeric;
fontVariantPosition;
fontWeight;
gap;
grid;
gridArea;
gridAutoColumns;
gridAutoFlow;
gridAutoRows;
gridColumn;
gridColumnEnd;
gridColumnStart;
gridRow;
gridRowEnd;
gridRowStart;
gridTemplate;
gridTemplateAreas;
gridTemplateColumns;
gridTemplateRows;
hangingPunctuation;
height;
hyphens;
hypenateCharacter;
imageRendering;
initialLetter;
inlineSize;
inset;
insetBlock;
insetBlockEnd;
insetBlockStart;
insetInline;
insetInlineEnd;
insetInlineStart;
isolation;
justifyContent;
justifyItems;
justifySelf;
left;
letterSpacing;
lineBreak;
lineHeight;
listStyle;
listStyleImage;
listStylePosition;
listStyleType;
margin;
marginBlock;
marginBlockEnd;
marginBlockStart;
marginBottom;
marginInline;
marginInlineEnd;
marginInlineStart;
marginLeft;
marginRight;
marginTop;
marker;
markerEnd;
markerMid;
markerStart;
mask;
maskClip;
maskComposite;
maskImage;
maskMode;
maskOrigin;
maskPosition;
maskRepeat;
maskSize;
maskType;
maxHeight;
maxWidth;
maxBlockSize;
maxInlineSize;
minBlockSize;
minInlineSize;
minHeight;
minWidth;
mixBlendMode;
objectFit;
objectPosition;
offset;
offsetAnchor;
offsetDistance;
offsetPath;
offsetPosition;
offsetRotate;
opacity;
order;
orphans;
outline;
outlineColor;
outlineOffset;
outlineStyle;
outlineWidth;
overflow;
overflowAnchor;
overflowWrap;
overflowX;
overflowY;
overscrollBehavior;
overscrollBehaviorBlock;
overscrollBehaviorInline;
overscrollBehaviorX;
overscrollBehaviorY;
padding;
paddingBlock;
paddingBlockEnd;
paddingBlockStart;
paddingBottom;
paddingInline;
paddingInlineEnd;
paddingInlineStart;
paddingLeft;
paddingRight;
paddingTop;
pageBreakAfter;
pageBreakBefore;
pageBreakInside;
paintOrder;
perspective;
perspectiveOrigin;
placeContent;
placeItems;
placeSelf;
pointerEvents;
position;
quotes;
resize;
right;
rotate;
rowGap;
scale;
scrollBehavior;
scrollMargin;
scrollMarginBlock;
scrollMarginBlockEnd;
scrollMarginBlockStart;
scrollMarginBottom;
scrollMarginInline;
scrollMarginInlineEnd;
scrollMarginInlineStart;
scrollMarginLeft;
scrollMarginRight;
scrollMarginTop;
scrollPadding;
scrollPaddingBlock;
scrollPaddingBlockEnd;
scrollPaddingBlockStart;
scrollPaddingBottom;
scrollPaddingInline;
scrollPaddingInlineEnd;
scrollPaddingInlineStart;
scrollPaddingLeft;
scrollPaddingRight;
scrollPaddingTop;
scrollSnapAlign;
scrollSnapStop;
scrollSnapType;
scrollbarColor;
shapeOutside;
tabSize;
tableLayout;
textAlign;
textAlignLast;
textCombineUpright;
textDecoration;
textDecorationColor;
textDecorationLine;
textDecorationStyle;
textDecorationThickness;
textEmphasis;
textEmphasisColor;
textEmphasisPosition;
textEmphasisStyle;
textIndent;
textJustify;
textOrientation;
textOverflow;
textShadow;
textTransform;
textUnderlineOffset;
textUnderlinePosition;
top;
transform;
transformOrigin;
transformStyle;
transition;
transitionDelay;
transitionDuration;
transitionProperty;
transitionTimingFunction;
translate;
unicodeBidi;
userSelect;
verticalAlign;
visibility;
whiteSpace;
widows;
width;
wordBreak;
wordSpacing;
wordWrap;
writingMode;
zIndex;
zoom;
constructor(options) {
Object.assign(this, options);
}
toKebab() {
const result = {};
for (const key of Object.keys(this)) {
const val = this[key];
if (val != null) {
const kebabKey = key.replace(
/[A-Z]/g,
(match) => "-" + match.toLowerCase()
);
result[kebabKey] = String(val);
}
}
return result;
}
toStyle() {
return { ...this };
}
};
// src/functions/changerFunctions/styleHelpers.ts
var styling = new Proxy({}, {
get(_, prop) {
return (value) => new CascadingStyleSheet({ [prop]: value });
}
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
CascadingStyleSheet,
styling
});