How to use the styles.useStyle function in styles

To help you get started, we’ve selected a few styles 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 tesseralis / polyhedra-viewer / src / components / HomePage / Masthead.tsx View on Github external
function VideoLink() {
  const css = useStyle({
    ...flexRow(undefined, 'center'),
    // make smaller to hide weird video artifacts
    height: videoHeight - 2,
    width: videoHeight - 2,
    overflow: 'hidden',
  });
  return (
    
      View random polyhedron
      <video height="{videoHeight}" src="{video}" playsinline="" autoplay="" muted="">
    
  );
}
</video>
github tesseralis / polyhedra-viewer / src / components / Viewer / MobileViewer / OperationsPanel.tsx View on Github external
...flexColumn(),
    height: '100%',
    pointerEvents: 'none',
    padding: scales.spacing[2],
  });

  const resizeButtons = useStyle({
    pointerEvents: 'initial',
  });

  const prompt = useStyle({
    marginTop: scales.spacing[2],
    marginBottom: 'auto',
  });

  const options = useStyle({
    marginTop: 'auto',
    marginBottom: scales.spacing[2],
  });

  const opGrid = useStyle({
    width: '100%',
    pointerEvents: 'initial',
  });

  // TODO I really wanna create a wrapper component for this...
  return (
    <section>
      <div>
        
      </div>
      <div></div></section>
github tesseralis / polyhedra-viewer / src / components / Viewer / MobileViewer / OperationsPanel.tsx View on Github external
export default function OperationsPanel() {
  const css = useStyle({
    ...flexColumn(),
    height: '100%',
    pointerEvents: 'none',
    padding: scales.spacing[2],
  });

  const resizeButtons = useStyle({
    pointerEvents: 'initial',
  });

  const prompt = useStyle({
    marginTop: scales.spacing[2],
    marginBottom: 'auto',
  });

  const options = useStyle({
    marginTop: 'auto',
    marginBottom: scales.spacing[2],
  });

  const opGrid = useStyle({
    width: '100%',
    pointerEvents: 'initial',
  });

  // TODO I really wanna create a wrapper component for this...
  return (
github tesseralis / polyhedra-viewer / src / components / HomePage / PolyhedronTable.tsx View on Github external
const Cell = ({ cell, colSpan = 1 }: { cell: string; colSpan?: number }) =&gt; {
  const isFake = cell[0] === '!';
  const polyhedron = fromConwayNotation(isFake ? cell.substring(1) : cell);

  const symbol = isFake ? `(${cell.substring(1)})` : cell;

  // Render a link for each cell, or a grayed-out link when indicated by an "!"
  const css = useCellStyle();
  const label = useStyle({ marginTop: scales.spacing[1] });
  return (
    
      {polyhedron ?  : cell}
      <div>{polyhedron &amp;&amp; symbol}</div>
    
  );
};
github tesseralis / polyhedra-viewer / src / components / HomePage / Description.tsx View on Github external
export default function Description({ title, content, collapsed }: Props) {
  const [isCollapsed, setCollapsed] = useState(collapsed);
  const toggle = () =&gt; setCollapsed(collapsed =&gt; !collapsed);
  const brief = content.split('\n\n')[0];

  const css = useStyle(flexColumn('center'));
  return (
    <div>
      <div>
        
      </div>
      {isCollapsed &amp;&amp; }
    </div>
  );
}
github tesseralis / polyhedra-viewer / src / components / HomePage / TableSection.tsx View on Github external
function Heading({ subsection, text }: { subsection: boolean; text: string }) {
  const H = subsection ? 'h3' : 'h2';
  const css = useStyle({
    marginBottom: scales.spacing[3],
    fontFamily: fonts.times,
    fontSize: subsection ? scales.font[4] : scales.font[3],
  });
  return {text};
}
github tesseralis / polyhedra-viewer / src / components / Viewer / common / InfoPanel.tsx View on Github external
function Heading({ polyhedron }: RenderProps) {
  const css = useStyle({
    fontSize: scales.font[3],
    marginBottom: scales.spacing[1],
    lineHeight: 1.25,
  });
  return (
    <h2>
      {_.capitalize(polyhedron.name)}, {polyhedron.symbol()}
    </h2>
  );
}
github tesseralis / polyhedra-viewer / src / components / HomePage / Masthead.tsx View on Github external
function Title() {
  const css = useStyle({
    marginBottom: scales.spacing[2],
    fontSize: scales.font[2],
    textAlign: 'center',
    fontWeight: 'bold',
    fontFamily: fonts.andaleMono,

    [media.mobile]: {
      fontSize: scales.font[3],
    },
  });
  return <h1>Polyhedra Viewer</h1>;
}
github tesseralis / polyhedra-viewer / src / components / ErrorPage.tsx View on Github external
function Title() {
  const css = useStyle({
    textAlign: 'center',
    fontFamily: fonts.andaleMono,
    fontSize: scales.font[3],
    [media.mobile]: {
      fontSize: scales.font[4],
    },
  });
  return <h1>Uh oh! We don't know about that polyhedron!</h1>;
}
github tesseralis / polyhedra-viewer / src / components / HomePage / Markdown.tsx View on Github external
return (props: any) =&gt; {
    const css = useStyle(styles);
    return ;
  };
}

styles

Compile your LESS stylesheets using JSON and underscore.

Unknown
Latest version published 12 years ago

Package Health Score

36 / 100
Full package analysis

Popular styles functions