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

Living styleguide for typography #6

Open
jhilden opened this issue Oct 18, 2012 · 2 comments
Open

Living styleguide for typography #6

jhilden opened this issue Oct 18, 2012 · 2 comments
Milestone

Comments

@jhilden
Copy link
Contributor

jhilden commented Oct 18, 2012

We need a way to extract the most important typographical styles from Sass stylesheets to render them in the Smurfville living styleguide

@jhilden
Copy link
Contributor Author

jhilden commented Oct 18, 2012

Here is a starting point on how I could imagine the Sass coding convention could look like for specifiy typography styles:
https://github.com/railslove/smurfville/blob/master/test/dummy/app/assets/stylesheets/_typography.sass

What do you think?

The hard (and key) part is obviously the parsing and rendering of that in the the Styleguide.
The approach I have been thingkin about is to get a concactinated/importet version of the app's Sass stylesheet and then add some dynamicly generated classes for the the differen typography at the end:

Here is what @chriseppstein told me, how this could be accomplished:
https://groups.google.com/forum/?fromgroups=#!searchin/sass-lang/jakob/sass-lang/lEgAANk7bvk/6RTYn5oszVUJ

@jhilden
Copy link
Contributor Author

jhilden commented Oct 22, 2012

With the 2 commits below we have support for a very basic support for a typography styleguide that works if all the definitions are done within a self-contained (e.g. no outside variables) Sass partial. For example like this one: https://github.com/railslove/smurfville/blob/master/test/dummy/app/assets/stylesheets/_typography.sass

Commits:
bbf018c
ecb240f

The biggest problem lies here:

#{Sass::Engine.new(File.read("#{Rails.root}/app/assets/stylesheets/_typography.sass") + render("typography_classes", typographies: @parser.typographies)).render}

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

1 participant