Add styling rules for good code examples in shared stylesheet #923
+15
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change primarily affects the C++ style guide: while a number of other style guides also use
<pre>
directly for code examples, the other style guides all use JS to prettyprint the code blocks, and the prettyprinter overrides the styles specified in the shared stylesheet.The exception is the AngularJS style guide, but it is already inconsistently formatted and this change does not make it any worse.
There are also several other style guides other than C++ where good/neutral are rendered identically; this commit does not attempt to address those either.
I copied the CSS rules from the internal C++ style guide. I did not attempt to make everything consistent; just the rules for
<pre>
and badcode/goodcode.As far as I can tell:
styleguide.css
is not derived from anything internal, nor is it automatically updated<pre>
with no class should be treated; I have opted to treat them as neutral here, though the internal style guide seems to treat them as good by default (which also seems wrong). That will be separately resolved.<pre>
for code formatting do not appear to be affected by this; they use a pretty printing script: