hypothesis / h

Annotate with anyone, anywhere.
https://hypothes.is/
BSD 2-Clause "Simplified" License
2.91k stars 425 forks source link

Style the new create-group-form #8797

Open seanh opened 3 days ago

seanh commented 3 days ago

Style the new create-group-form to look similar to the legacy one, but using Tailwind for CSS.

This involves a lot of hard-coded values that we'll probably want to replace.

Screenshot from 2024-07-05 17-34-00

robertknight commented 16 hours ago

A few general things about JSX and Preact components:

import { useId } from 'preact/hooks';

function Widget() {
  const fooId = useId();
  return <>
    <label htmlFor={fooId}>Some field</label>
    <input id={fooId}/>
  </>
}
function CharCounter({ value, limit }: { value: number; limit: number }) {
  return (
    <div className="flex">
      <div className="grow" />
      <span className="text-grey-6">
        {value}/{limit}
      </span>
    </div>
  );
}
...
<CharCounter value={0} limit={250}/>

Some notes about styling: