Skip to content

eobrain/classless-tufte-css

 
 

Repository files navigation

Classless Tufte CSS

This is a modification of the original Tufte CSS to remove reliance on class attributes so it can be applied to purely semantic HTML.

Edward Tufte uses a distinctive style in his handouts: simple, with well-set typography, extensive sidenotes, and tight integration of graphics and charts. tufte-css brings that style to HTML documents.

This original project was directly inspired by and based on Tufte-LaTeX and the R Markdown Tufte Handout.

Getting Started

The file index.html is a self-describing demonstration document that walks through the features of Tufte CSS. The live version at https://eobrain.github.io/classless-tufte-css/ is the best overview of the project.

To use Tufte CSS, just add the following to your HTML doc's head block:

<link rel="stylesheet" href="https://unpkg.com/classless-tufte-css@1.3.0/tufte.min.css"/>

(See the live version for instructions for how to host the CSS and font files yourself.)

Minimal Example

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <title>Title Goes Here</title>
    <link rel="stylesheet" href="https://unpkg.com/classless-tufte-css@1.3.0/tufte.min.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
</head>

<body>
    <article>
        <h1>Title Goes Here</h1>
        <p>Subtitle goes Here</p>
        <section>
            <h2>Section Header goes here</h2>
            <blockquote>
                <p>Epigraph goes here</p>
                <footer>Attribution goes here</footer>
            </blockquote>
            <p>Main text starts here</p>
            <aside>Margin note goes here</aside>
        </section>
        <section>
            <p>All-caps line goes here</p>
            <ul>
                <li>List item in margin</li>
                <li>List item</li>
            </ul>
            <figure>
                <img src="https://dummyimage.com/2000x200/" />
                <figcaption>Inline figure</figcaption>
            </figure>
            <aside>
                <figure>
                    <img src="https://dummyimage.com/2000x200/" />
                    <figcaption>Margin figure</figcaption>
                </figure>
            </aside>
        </section>
        <section>
            <ul>
                <li>Inline list item</li>
                <li>List item</li>
            </ul>
        </section>
        <figure>
            <img src="https://dummyimage.com/2000x200/" />
            <figcaption>Fullwidth figure</figcaption>
        </figure>
    </article>
</body>

</html>

See this minimal example live.

Project Scope and Status

Classless Tufte CSS is specifically a CSS-only solution for styling HTML for the web.

That means that JavaScript solutions, although often superior to pure CSS, are out of scope for this project and will not be used. Also out of scope are handling printed versions of web pages and integration with static site generators or other formats. Thankfully, all these useful applications can be well served by separate work that builds on top of Classless Tufte CSS.

Deploying

  1. Make changes
  2. Bump version in package.json, examples, and docs to new version with semver form X.Y.Z
  3. From shell, npm install
  4. From shell: npm publish
  5. Commit changes to git
  6. From shell: git push
  7. From shell: git tag vX.Y.Z
  8. From shell: git push --tags

Contributing

To contribute the original Tufte CSS project see their Contributing instructions.

Contributions are also welcome to this version in the same way, by opening an issue, or better yet, a pull request with how you think it should be fixed.

Contributors

License

Released under the MIT license. See LICENSE.

About

Style your webpage like Edward Tufte’s handouts.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 67.2%
  • CSS 32.8%