Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want to include custom Sass/CSS in a rendered njk/HTML example #153

Open
mirisuzanne opened this issue Aug 27, 2017 · 5 comments
Open
Assignees
Milestone

Comments

@mirisuzanne
Copy link
Member

For a project like Susy (with no output CSS to include globally), or project examples that require special context/framing, it would be useful to include both markup and custom styles in a single rendered example. The CSS would be added to the head of the rendered iframe document, with markup added to the body for rendering. There would be two possible approaches to this…

Implicit Rendering:

  • All html (or html-compiled) examples are rendered. This is the current behavior.
  • We just need a syntax for adding CSS/Sass to one of those examples.

Explicit Rendering:

  • Nothing is rendered by default.
  • We add an @render or @preview annotation syntax, that accepts multiple example-block keys (not sure what we use as the hook) – rendering the selected examples together.
@wlonk
Copy link
Contributor

wlonk commented Sep 27, 2017

Current workaround is to use external Sass files.

@wlonk wlonk modified the milestones: Herman 1.0, Herman 1.x Stretch Goals Sep 27, 2017
@wlonk
Copy link
Contributor

wlonk commented Sep 27, 2017

@mirisuzanne if you can give a more explicit example, we can work out what it'll take in the rendering side of things.

@jgerigmeyer
Copy link
Member

Instead of linking an @example scss/css with an @example html/njk, might we want a flag that automatically adds the documented Sass to the rendered markup example?

@robsonsobral
Copy link
Contributor

might we want a flag that automatically adds the documented Sass to the rendered markup example?

I think not exactly the documented, but the @example scss, so a mixin can be showed.

@mirisuzanne
Copy link
Member Author

Yeah, I could see both being useful, depending on the situation. But only showing the documented block is not likely to cover most cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants