How to use the linaria.cx function in linaria

To help you get started, we’ve selected a few linaria 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 s-panferov / tygen / packages / tygen-html / src / ref-link.tsx View on Github external
if (!link) {
			console.error(idFrom, preparedLink)
			throw new Error('Cannot build a link for a reflection without an Id')
		}

		const { name: linkName, href } = link
		const linkNames = (name || linkName).split('/').filter(Boolean)
		const isPath = linkNames.length > 1

		const relativeHref = normalizePath(settings, href)

		return (
			<a href="{relativeHref}" id="{link.anchor}">
				{typeof this.props.children === 'function'
					? this.props.children(link)
					: this.props.children ||
					  linkNames.map((name, i) =&gt; {
							return (
								<span>
									{name}
									{i !== linkNames.length - 1 ? '/' : ''}
								</span></a>
github disjukr / just-news / src / view / Reporters.tsx View on Github external
const Reporter: FunctionComponent = ({ name, mail }) =&gt; {
    return <li>
        <span class="name">{ name }</span>
        <span class="{cx(css`">{ mail }</span>
    </li>;
};
github s-panferov / tygen / packages / tygen-html / src / pre / index.tsx View on Github external
export const PrimitiveType = (props: React.HTMLAttributes) =&gt; (
	<span>{props.children}</span>
)
github s-panferov / tygen / packages / tygen-html / src / type / intersection.tsx View on Github external
render() {
		const { reflection } = this.props
		const sep = reflection.typeKind === TypeKind.Intersection ? '&amp;' : '|'
		const long = reflection.types.length &gt; 3
		return (
			<span>
				{reflection.types.map((type, i) =&gt; {
					return (
						<span>
							{(long || i !== 0) &amp;&amp; <span>{sep}</span>}
							
						</span>
					)
				})}
			</span>
		)
	}
}
github zerobias / effector / website / try / components / Stats.js View on Github external
({event, store, effect, domain}, tab) =&gt; {
    const className = `toolbar ${cx(
      tab === 'events' &amp;&amp; 'show-events',
      tab === 'storages' &amp;&amp; 'show-storages',
      tab === 'effects' &amp;&amp; 'show-effects',
      tab === 'domains' &amp;&amp; 'show-domains',
      tab === 'dom' &amp;&amp; 'show-dom',
    )}`
    return (
      <ul>
        {event.length &gt; 0 &amp;&amp; (
          <li>
            Events
          </li>
        )}
        {store.length &gt; 0 &amp;&amp; (
          <li>
            Storages</li></ul>
github hemlok / spring-keyframes / packages / react-linaria / src / Component.tsx View on Github external
options,
  })

  React.useEffect(() =&gt; {
    if (visible) setRender(true)
  }, [visible])

  const onAnimationEnd = (e: React.AnimationEvent) =&gt;
    !visible &amp;&amp; e.animationName === `spring-${remove}` &amp;&amp; setRender(false)

  return (
    shouldRender &amp;&amp; (
      //@ts-ignore
      
        {children}
      
    )
  )
}
github guandjoy / redfish / src / react-app / src / application / Spinner.js View on Github external
{props.strokeTransition &amp;&amp; (
            
          )}
        
      )
    );
  }

  return (
    <div>
      <svg viewBox="{`0">{paths}</svg>
      {props.lable &amp;&amp; <span>{props.lable}</span>}
    </div>
  );
}
github callstack / linaria / website / src / components / Heading.js View on Github external
case 'h1':
      headingStyle = heading1;
      break;
    case 'h2':
      headingStyle = heading2;
      break;
    case 'h3':
      headingStyle = heading3;
      break;
    default:
      headingStyle = heading4;
      break;
  }

  const passedProps = Object.assign({}, props, {
    className: cx(headingStyle, props.className),
  });

  return React.createElement(props.type, passedProps);
}
github s-panferov / tygen / packages / tygen-html / src / ui / outline.tsx View on Github external
render() {
		const { icon, header, children, collapsible } = this.props
		return (
			<div>
				<div>{icon}</div>
				<div>{header}</div>
				{children &amp;&amp; <div>{children}</div>}
			</div>
		)
	}
}
github s-panferov / tygen / packages / tygen-html / src / comment.tsx View on Github external
if (reflection.tags) {
				const tagObj = reflection.tags.find(t =&gt; t.name === tag)
				if (tagObj &amp;&amp; tagObj.text) {
					text.push(tagObj.text)
				}
			}
		} else if (reflection.comments) {
			text.push(...reflection.comments.filter(c =&gt; c.kind === 'text').map(doc =&gt; doc.text))
		}

		if (text.length === 0) {
			return null
		}

		return (
			<div>
				{text.map((text, i) =&gt; {
					return 
				})}
			</div>
		)
	}
}