FormidableLabs / spectacle

A React-based library for creating sleek presentations using JSX syntax that gives you the ability to live demo your code.
https://commerce.nearform.com/open-source/spectacle/
MIT License
9.77k stars 693 forks source link

`spectacle`: Full width / "fit" text feature. #1211

Open ryan-roemer opened 2 years ago

ryan-roemer commented 2 years ago

Spectacle used to have a fit prop on many components that would fill the entire width of the slide -- either as single or multiple words. Here's a presentation where I used it variously:

Old examples

In a heading

        <Slide id="title" bgImage={images.polygons}>
          <Text bold fit caps textColor="primary" textFont="primary">
            Wrangling
          </Text>
          <Text bold fit caps textColor="primary" textFont="primary">
            Large Scale
          </Text>
          <Text bold fit caps textColor="primary" textFont="primary">
            Frontend Web Applications
          </Text>
          {/* ... *}
        </Slide>

Screen Shot 2022-08-22 at 2 52 57 PM

With appear component

(Keep hitting arrow/space to see all. I'm pretty sure our appear feature is different then this now, but you get the idea.)

        <Slide bgColor="tertiary" bgImage={images.polygonsGray}
          notes={notes(
            "Each of these trends are <b>scary</b>",
            "... and present great <b>opportunity</b>"
          )}>
          <Appear fid="1">
            <Heading bold fit caps textColor="lightestGray">
              Lots of JavaScript
            </Heading>
          </Appear>
          <Appear fid="2">
            <Heading bold fit caps textColor="primary">
              In the browser
            </Heading>
          </Appear>
          <Appear fid="3">
            <Heading bold fit caps textColor="lightestGray">
              Written by large teams
            </Heading>
          </Appear>
        </Slide>

Screen Shot 2022-08-22 at 2 52 47 PM

With a background

        <Slide bgImage={images.bgCowboyPilot} bgDarken={0.35}>
          <Heading bold fit caps textColor="lightestGray">
            The Fundamental Challenge:
          </Heading>
          <Heading bold fit caps textColor="primary">
            JavaScript is the
          </Heading>
          <Heading bold fit caps textColor="lightestGray">
            Wild, Wild West
          </Heading>
        </Slide>

Screen Shot 2022-08-22 at 2 52 38 PM

Task