How to use the glamor.css function in glamor

To help you get started, we’ve selected a few glamor 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 segmentio / evergreen / src / theme / src / default-theme / utils / memoizeClassName.tsx View on Github external
return (...args: A): string => {
    // Create a key by joining all args.
    const key = args.join('_') || '__no_args__'

    // Check if is already memoized, if so return the result.
    if (memo[key]) return memo[key]

    // Create a new entry in the memo with the generated className.
    memo[key] = css(fn(...args)).toString()

    // Return the newly generated className.
    return memo[key]
  }
}
github segmentio / evergreen / src / theme / src / defaultTheme.js View on Github external
return (...args) => {
    // Creat a key by joining all args.
    const key = args.join('_')

    // Check if is already memoized, if so return the result.
    if (memo[key]) return memo[key]

    // Creat a new entry in the memo with the generated className.
    memo[key] = css(fn(...args)).toString()

    // Return the newly generated className.
    return memo[key]
  }
}
github kentcdodds / css-in-js-precompiler / src / babel-plugin.js View on Github external
function glamorize(literalNodePath) {
              let obj
              const {code} = babel.transformFromAst(
                t.program([t.expressionStatement(toLiteral(literalNodePath))]),
              )
              // eslint-disable-next-line no-eval
              eval(`obj = ${code}`)
              const className = glamor.css(obj).toString()
              return className
            }
          })
github orbiting / styleguide / src / components / TeaserFront / TypoHeadline.js View on Github external
export const Interaction = ({ children, large, medium, small }) => {
  const sizedStyle = css(
    styles.interaction,
    sansSerifSizes.default,
    (large && sansSerifSizes.large) ||
      (medium && sansSerifSizes.medium) ||
      (small && sansSerifSizes.small) ||
      {}
  )
  return (
    <h1>
      {children}
    </h1>
  )
}
github keystonejs / keystone-classic / admin / client / App / elemental / Pagination / page.js View on Github external
function Page ({
	disabled,
	selected,
	...props
}) {
	props.className = css(
		classes.page,
		!!disabled &amp;&amp; classes.disabled,
		!!selected &amp;&amp; classes.selected
	);
	return (
		<button>
	);
};
</button>
github keystonejs / keystone-classic / admin / client / App / elemental / Container / index.js View on Github external
function Container ({
	className,
	clearFloatingChildren,
	component: Component,
	width,
	...props
}) {
	props.className = css(
		classes.container,
		classes[width],
		clearFloatingChildren ? classes.clearfix : null,
		className
	);

	return ;
};
github keystonejs / keystone-classic / admin / client / App / elemental / Modal / footer.js View on Github external
function ModalFooter ({
	align,
	className,
	...props
}) {
	return (
		<div>
	);
};
</div>
github keystonejs / keystone-classic / admin / client / App / elemental / Spinner / index.js View on Github external
function Spinner ({ className, size, color, ...props }) {
	props.className = css(
		classes.base,
		classes[size],
		className
	);

	return (
		<div>
			<span>
			<span>
			<span>
			Loading...
		</span></span></span></div>
	);
};
github orbiting / styleguide / src / components / TeaserFront / Split.js View on Github external
aboveTheFold,
  feuilleton
}) =&gt; {
  const background = bgColor || ''
  const flexDirection = reverse ? 'row-reverse' : ''
  const bylinePosition = feuilleton
    ? 'belowFeuilleton'
    : portrait
    ? reverse
      ? 'left'
      : 'right'
    : 'below'
  return (
    <div style="{{">
      <div></div></div>
github orbiting / styleguide / src / components / TeaserCarousel / Tile.js View on Github external
const tileStyle = merge(
    styles.tile,
    {
      border: outline ? `1px solid ${outline}` : 'none',
      color,
      backgroundColor: bgColor,
      cursor: onClick ? 'pointer' : 'default',
      padding: bigger ? '0 0 20px 0' : '30px 15px',
      alignItems: bigger ? 'flex-start' : 'center'
    },
    context.tileCount &lt; 3 &amp;&amp; { width: `${100 / context.tileCount}%` },
    context.tileMaxWidth &amp;&amp; { maxWidth: context.tileMaxWidth }
  )

  const containerStyle = css(styles.container, {
    margin: bigger ? '0' : '0 auto'
  })

  const imageProps = image &amp;&amp; FigureImage.utils.getResizedSrcs(image, 450, true)
  const imageContainerStyles = bigger
    ? styles.imageContainerBigger
    : styles.imageContainer

  const imageStyles = bigger ? styles.imageBigger : styles.image

  const isPortrait =
    imageProps &amp;&amp;
    imageProps.size &amp;&amp;
    imageProps.size.width / imageProps.size.height &lt;= 1
      ? true
      : false

glamor

inline css for component systems

MIT
Latest version published 7 years ago

Package Health Score

59 / 100
Full package analysis

Popular glamor functions