8000 Add variants section to docs by MichaelDeBoey · Pull Request #282 · tailwindlabs/tailwindcss · GitHub
Skip to content

Conversation

@MichaelDeBoey
Copy link
Contributor

@MichaelDeBoey MichaelDeBoey commented Dec 2, 2017

As requested by @adamwathan on Twitter 🙂

Not all is done yet, but thinking about making a partial for it?

8000
@MichaelDeBoey
Copy link
Contributor Author

MichaelDeBoey commented Dec 2, 2017

Also the flexbox docs aren't in 1 place, so what would be a good solution for them?
copy/paste in each file?
Add a specific "global flexbox" file? If so, how do we handle the navigation for this one?

@adamwathan
Copy link
Member

You are a madman! I was going to be happy to even see a PR come through that updated a single page 😄

The only change I would love to make if you don't mind is replacing this language:

By default, no hover, focus, or group-hover variants are generated for...

I think phrasing it that way made sense for the SVG page where no variants are generated at all, but for modules that do have variants I think it's more useful to say:

By default, only responsive variants are generated for...

...or:

By default, only responsive and hover variants are generated for...

Thanks man, this is amazing!

@adamwathan
Copy link
Member

Oh, re: flexbox stuff, it is admittedly a bit of a tricky one. We considered making each section it's own module but it seemed unnecessary; I think people want all of flexbox or none of it.

I think we can just copy and paste the same language on each page, and maybe add a note like:

Note that modifying the flexbox property will affect what variants are generated for all Flexbox modules, not just the (align items|justify content|etc) utilities.

...after the code sample block or something?

@MichaelDeBoey
Copy link
Contributor Author

Figured I just do every doc page, so this one is done 🙂

Will make the extra note for the flexbox utilities 🙂

What about extracting into a separate component?
Maybe this can be done for the hoverable piece also (will make a new PR for that if approved 🙂)

@adamwathan
Copy link
Member

I don't mind the idea of creating a partial for it but would want to try and make it flexible so we could still tweak the language per-page if necessary, or provide a different code sample if we wanted to.

@MichaelDeBoey
Copy link
Contributor Author

MichaelDeBoey commented Dec 2, 2017

@adamwathan I think we can start with a partial for almost all the utility pages, but have a custom piece on the special pages (svg, spacing, ...)?

}
```

Note that modifying the `flexbox property will affect what variants are generated for _all_ flexbox modules, not just the align-content utilities.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing closing backtick here after flexbox

@MichaelDeBoey
Copy link
Contributor Author

Fixed in 923a5a2 🙂

@MichaelDeBoey
Copy link
Contributor Author

MichaelDeBoey commented Dec 2, 2017

@adamwathan Do you prefer the use of the Prism library for the syntax highlighting or do I create a custom version like in the customized-config partial?

I think the custom one looks a bit nicer with the comments' color, less spacing for the "tabs", ...

@adamwathan
Copy link
Member

Yeah I’m ok with using a custom one here, it makes it easier to do a nice diff-ish format where we can show both the default variants and a customized version for each example 👍🏻

@MichaelDeBoey
Copy link
Contributor Author

tbh, I was more thinking about something like (I like the highlight of the strings):
schermafbeelding 2017-12-03 om 01 09 22
But you prefer more something like
schermafbeelding 2017-12-03 om 01 09 15
Can try to figure out the string highlighting inside the + part if you want?

@adamwathan
Copy link
Member

Yeah fine to just use normal Prism stuff like we already are too, honestly no big deal to me either way. It's nice to show the default values in code is all, but maybe could add that later as just another code block after the first sentence about the default value. A bit annoying just because the code blocks take up a lot of space since we show the full context, which I also think is important.

@MichaelDeBoey
Copy link
Contributor Author

I like the diff-ish idea, but also like the Prism highlighting 😛
Will keep the diff-ish custom partial we already use 🙂

schermafbeelding 2017-12-03 om 02 05 48

@MichaelDeBoey
Copy link
Contributor Author

MichaelDeBoey commented Dec 3, 2017

@adamwathan All is extracted to a partial 🙂
Only the svg and spacing docs aren't extracted to the partial yet, because they're special cases with multiple utilities that get changed, and that's not (yet) supported by the partial.

@MichaelDeBoey
Copy link
Contributor Author

@adamwathan Don't know if it's a good idea to make the partial more complicated to also support docs like the svg and spacing ones?

@adamwathan
Copy link
Member

adamwathan commented Dec 3, 2017 via email

@MichaelDeBoey
Copy link
Contributor Author

OK then this one can be merged I think 🙂

Maybe @reinink or @davidhemphill have some thoughts about this one yet? 🙂

@MichaelDeBoey MichaelDeBoey changed the title [WIP] Add variants section to docs Add variants section to docs Dec 3, 2017
@adamwathan adamwathan merged commit c601321 into tailwindlabs:master Dec 3, 2017
@adamwathan
Copy link
Member

Merged, thanks!

@MichaelDeBoey MichaelDeBoey deleted the add-variants-section-to-docs branch December 4, 2017 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants