How to use @xstyled/system - 10 common examples

To help you get started, we’ve selected a few @xstyled/system examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / xstyled__system / xstyled__system-tests.tsx View on Github external
);

// TH

th('colors.primary900')({});

th.color(2)({});
th.color('primary')({});

th.px(2)({});
th.px('2rpx')({});

th.percent(0.3)({});
th.percent('20em')({});

th.radius(2)({});
th.radius('sm')({});

th.transition(2)({});
th.transition('fade')({});

th.space(2)({});
th.space('sm')({});

th.size(2)({});
th.size('sm')({});

th.font(2)({});
th.font('body')({});

th.lineHeight(2)({});
th.lineHeight('sm')({});
github DefinitelyTyped / DefinitelyTyped / types / xstyled__system / xstyled__system-tests.tsx View on Github external
const InnerSystemComponentBox = createSystemComponent(React, 'div', shadows);

const SystemComponentBox = styled(InnerSystemComponentBox)`
    ${shadows}
`;

const systemComponentBoxTest = () => (
    <div>
        
    </div>
);

// TH

th('colors.primary900')({});

th.color(2)({});
th.color('primary')({});

th.px(2)({});
th.px('2rpx')({});

th.percent(0.3)({});
th.percent('20em')({});

th.radius(2)({});
th.radius('sm')({});

th.transition(2)({});
th.transition('fade')({});
github DefinitelyTyped / DefinitelyTyped / types / xstyled__system / xstyled__system-tests.tsx View on Github external
default: 'primary',
    variants: {
        primary: 'color: red',
        secondary: 'color: blue',
    },
})({});

// Responsive Utilities

breakpoints({
    xs: 'color: red',
    md: 'color: blue',
    lg: 'color: green',
})({});

up('md', 'color: red')({});

down('md', 'color: red')({});

between('md', 'lg', 'color: red')({});

// RPX Transformers

rpxTransformers.px(16).toString();
rpxTransformers.px('16rpx').toString();
rpxTransformers.border(10).toString();
rpxTransformers.border('10px solid').toString();
github DefinitelyTyped / DefinitelyTyped / types / xstyled__system / xstyled__system-tests.tsx View on Github external
th.fontWeight('heavy')({});

th.letterSpacing(2)({});
th.letterSpacing('sm')({});

th.fontSize(2)({});
th.fontSize('sm')({});

th.zIndex(2)({});
th.zIndex('modal')({});

th.border(2)({});
th.border('main')({});

th.borderWidth(2)({});
th.borderWidth('sm')({});

th.borderStyle(2)({});
th.borderStyle('selected')({});

th.shadow(2)({});
th.shadow('xl')({});

// Style

const size = style({
    prop: ['size', 's'],
    cssProperty: ['width', 'height'],
    themeGet: getFontSize,
});

const StyleBox = styled.div&lt;{ size: FontSizeProps['fontSize']; s: FontSizeProps['fontSize'] }&gt;`
github DefinitelyTyped / DefinitelyTyped / types / xstyled__system / xstyled__system-tests.tsx View on Github external
th.fontWeight(2)({});
th.fontWeight('heavy')({});

th.letterSpacing(2)({});
th.letterSpacing('sm')({});

th.fontSize(2)({});
th.fontSize('sm')({});

th.zIndex(2)({});
th.zIndex('modal')({});

th.border(2)({});
th.border('main')({});

th.borderWidth(2)({});
th.borderWidth('sm')({});

th.borderStyle(2)({});
th.borderStyle('selected')({});

th.shadow(2)({});
th.shadow('xl')({});

// Style

const size = style({
    prop: ['size', 's'],
    cssProperty: ['width', 'height'],
    themeGet: getFontSize,
});
github DefinitelyTyped / DefinitelyTyped / types / xstyled__system / xstyled__system-tests.tsx View on Github external
th.font('body')({});

th.lineHeight(2)({});
th.lineHeight('sm')({});

th.fontWeight(2)({});
th.fontWeight('heavy')({});

th.letterSpacing(2)({});
th.letterSpacing('sm')({});

th.fontSize(2)({});
th.fontSize('sm')({});

th.zIndex(2)({});
th.zIndex('modal')({});

th.border(2)({});
th.border('main')({});

th.borderWidth(2)({});
th.borderWidth('sm')({});

th.borderStyle(2)({});
th.borderStyle('selected')({});

th.shadow(2)({});
th.shadow('xl')({});

// Style

const size = style({
github DefinitelyTyped / DefinitelyTyped / types / xstyled__system / xstyled__system-tests.tsx View on Github external
th.font(2)({});
th.font('body')({});

th.lineHeight(2)({});
th.lineHeight('sm')({});

th.fontWeight(2)({});
th.fontWeight('heavy')({});

th.letterSpacing(2)({});
th.letterSpacing('sm')({});

th.fontSize(2)({});
th.fontSize('sm')({});

th.zIndex(2)({});
th.zIndex('modal')({});

th.border(2)({});
th.border('main')({});

th.borderWidth(2)({});
th.borderWidth('sm')({});

th.borderStyle(2)({});
th.borderStyle('selected')({});

th.shadow(2)({});
th.shadow('xl')({});

// Style
github DefinitelyTyped / DefinitelyTyped / types / xstyled__system / xstyled__system-tests.tsx View on Github external
);

// Compose

const customSystem = compose(margin, padding);

type CustomSystemBoxProps = MarginProps &amp; PaddingProps;

const CustomSystemBox = styled.div`
    ${customSystem}
`;

const customSystemBoxTest = () =&gt; (
    <div>
        
    </div>
);

// createSystemComponent

const InnerSystemComponentBox = createSystemComponent(React, 'div', shadows);
github DefinitelyTyped / DefinitelyTyped / types / xstyled__system / xstyled__system-tests.tsx View on Github external
type CustomSystemBoxProps = MarginProps &amp; PaddingProps;

const CustomSystemBox = styled.div`
    ${customSystem}
`;

const customSystemBoxTest = () =&gt; (
    <div>
        
    </div>
);

// createSystemComponent

const InnerSystemComponentBox = createSystemComponent(React, 'div', shadows);

const SystemComponentBox = styled(InnerSystemComponentBox)`
    ${shadows}
`;

const systemComponentBoxTest = () =&gt; (
    <div>
        
    </div>
);

// TH

th('colors.primary900')({});

th.color(2)({});
github DefinitelyTyped / DefinitelyTyped / types / xstyled__system / xstyled__system-tests.tsx View on Github external
primary: 'color: red',
        secondary: 'color: blue',
    },
})({});

// Responsive Utilities

breakpoints({
    xs: 'color: red',
    md: 'color: blue',
    lg: 'color: green',
})({});

up('md', 'color: red')({});

down('md', 'color: red')({});

between('md', 'lg', 'color: red')({});

// RPX Transformers

rpxTransformers.px(16).toString();
rpxTransformers.px('16rpx').toString();
rpxTransformers.border(10).toString();
rpxTransformers.border('10px solid').toString();