-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Provide complete CSS by leveraging fixture classes #39
Conversation
This lets us properly support [rendering GitHub permalinks](sindresorhus/github-markdown-css#100), useful when using the GitHub markdown API. Also make sure we only scan declarations when checking for prettylights vars, otherwise it can crash on comment nodes.
TIL the +.markdown-body .Box-body.scrollable-overlay {
+ max-height: 400px;
+ overflow-y: scroll;
+}
+.markdown-body .commit-tease-sha {
+ display: inline-block;
+ font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
+ font-size: 90%;
+ color: #f0f6fc;
+}
+.markdown-body .blob-wrapper {
+ overflow-x: auto;
+ overflow-y: hidden;
+} The I'm not sure whether adding them is right idea since people not using the API would less possible to generate HTML like that. On the other hand, the fixture could be outdated and not covering all possible cases that GitHub supports. |
Should we put it behind a
I think using the fixture would be less error prone than relying solely on a managed list of allowed classes. That way if the fixture reflects most common use cases, the output CSS is guaranteed to cover them even as GitHub updates their styles. |
LGTM 👍 Another idea is that these components are actually implemented in the primer package (GitHub open-sourced their front-end). They must starts-with an uppercase letter. Because usually our markdown renderer (either markdown-it, marked.js, remark, etc.) doesn't generate this kind of classes, they can be erased with a regex:
You're right. We can improve that file in the future. |
It's not clear to be whether https://github.com/sindresorhus/github-markdown-css should use |
@sindresorhus If you are using github-markdown.css with Also it adds about 200 lines to the dark theme file which was 1100 lines. We do have some CSS like this before. For example the syntax highlighting, which for now there is starry-night. |
I suppose it's a question of would you rather have I ended up with unstyled markdown elements in production because it used to be more complete, but when I updated to newer version it was more stripped down and I didn't catch it. I think I would default to complete and let people add the generator to their pipeline if they need to save the extra KB. We could instead generate an extra file in |
This new feature may lead to an unexpected behavior on Which add an additional style property |
Fixes sindresorhus/github-markdown-css#100 and lets us properly support permalinks, useful when using the GitHub Markdown API.
Also make sure we only scan declarations when checking for
prettylights
vars, otherwise it can crash on comment nodes.