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

Build out Highlight component to auto format, consolidate global code styling #80

Merged
merged 1 commit into from
Oct 4, 2019

Conversation

kylesuss
Copy link
Contributor

Build out the Highlight component so that it can work with both:

  1. Unformatted code (we have to now pass in a prop to Highlight to tell it what language to use in this case)
.someCode {
  display: block;
}
  1. Pre-formatted code (this will come from transformers of some sort, such as gatsby-transformer-remark). This format appears to be a standard and it seems to work well with Prismjs which is the syntax highlighting library in use in this repo. No language required as a prop since the data is already in the markup.
<pre class="language-css"><code class="language-css">
.someCode {
  display: block;
}
</pre></code>

In the process, I noticed some duplication in the global styles that we are exporting for styling pre and code blocks. Those styles have since been moved to the Highlight component.

Heads up @jonniebigodes since I know you were potentially going to be looking at this component.

@kylesuss
Copy link
Contributor Author

@domyen mind looking at this one? Ultimately, the color scheme in this one will become the "standard" for all of the consumers.

The font size that was defined for code blocks in the global styles is smaller than what we were using on LSB though. That can be customized on a per-app basis, or we can just roll w/ the new smaller size once implemented? What do you think?

@domyen
Copy link
Member

domyen commented Oct 4, 2019

LGTM

Re: font size
Let's customize it per situation. LSBs should be bigger than we we'd use in the Chromatic app UI.

@kylesuss kylesuss added minor Increment the minor version when merged enhancement New feature or request labels Oct 4, 2019
@kylesuss kylesuss merged commit c529a9d into master Oct 4, 2019
@kylesuss kylesuss deleted the build-out-highlight branch October 4, 2019 22:43
@kylesuss
Copy link
Contributor Author

kylesuss commented Oct 7, 2019

🚀 PR was released in v1.1.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor Increment the minor version when merged released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants