How to use glamor - 10 common examples

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 / Figure / Byline.js View on Github external
export const Byline = ({ children, attributes, style, position }) => {
  return (
    <span style="{style}">
      {children}
    </span>
  )
}
github orbiting / publikator-frontend / lib / components / EditorFrame.js View on Github external
render () {
    const { children, repository, commit, view, spaceLeft } = this.props

    return (
      <div>
        <nav>
          
        </nav>
        <div>
          {children}
        </div>
      </div>
    )
  }
}
github orbiting / styleguide / src / components / Form / Label.js View on Github external
export const LSpan = ({ black, white, ...props }) =&gt; (
  <span>
)
</span>
github orbiting / styleguide / src / components / TitleBlock / index.js View on Github external
const TitleBlock = ({ children, attributes, center, margin }) =&gt; {
  return (
    <section style="{{">
      {children}
    </section>
  )
}
github pluralsight / design-system / packages / tag / src / react / index.js View on Github external
tag: (themeName, { href, icon, isPressed, onClick, size }) => {
    const label = 'psds-tag'
    const clickable = href || onClick

    return compose(
      css(stylesheet[`.${label}`]),
      css(stylesheet[`.${label}.psds-theme--${themeName}`]),
      clickable && css(stylesheet[`.${label}--clickable`]),
      clickable &&
        css(stylesheet[`.${label}--clickable.psds-theme--${themeName}`]),
      css(stylesheet[`.${label}--size-${size}`]),
      icon && css(stylesheet[`.${label}--icon`]),
      isPressed && css(stylesheet[`.${label}--isPressed`])
    )
  },
  label: (themeName, { icon }) => {
github orbiting / styleguide / src / components / TeaserFront / TypoHeadline.js View on Github external
export const Interaction = ({ children, large, medium, small }) =&gt; {
  const sizedStyle = css(
    styles.interaction,
    sansSerifSizes.default,
    (large &amp;&amp; sansSerifSizes.large) ||
      (medium &amp;&amp; sansSerifSizes.medium) ||
      (small &amp;&amp; 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>

glamor

inline css for component systems

MIT
Latest version published 7 years ago

Package Health Score

59 / 100
Full package analysis

Popular glamor functions