Comments (6)
What about this workaround?
pre
code
font-size inherit
from sakura.
I checked it on a couple of fonts, and typically monospace fonts tend to consume larger visual space for the same content as other fonts.
On my blog: https://oxal.org/blog/fizzbuzz-in-clojure/ setting code
to the same size as the text looks weird and non-proportional.
Bootstrap also seems to be reducing the font size of pre
and code
tags.
So I feel like we should keep the small size of code
and make it consistent by adding it to pre
as well.
from sakura.
You definitely have much more experience than me to judge on this (mine is not much more than the two examples above 😄) so go ahead with what you feel better for the project! And thanks for sakura which is very nice!
from sakura.
That's a great idea! Nice thinking :)
There was a different approach to solve this in #52 it seems. I've merged that in. But pre > code inherit seems more cleaner. Either works :)
Feel free to add a PR if you want to update it!
from sakura.
Yes, you are right. I had initially set font-size
for code
tags to be 10% smaller because I usually use a monospace font for code.
Monospace fonts are usually larger in size than serif/sans-serif. To compensate for that I must have originally reduced the size of the code tag.
We can either reduce the size of pre
tag too or just get rid of this assumption. Any thoughts are welcome!
from sakura.
Thanks for the quick reply!
Another html:
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<meta content="width=device-width, initial-scale=1" name="viewport">
<link rel='stylesheet' href='https://unpkg.com/normalize.css/' type='text/css'>
<link rel="stylesheet" href="https://unpkg.com/sakura.css/css/sakura.css" type="text/css">
</head>
<body>
<p>Paragraph with <code>code</code> inline (default size)</p>
<p>Paragraph with <code style="font-size: 1em;">code</code> inline (size <tt>1em</tt>)</p>
<pre><code>This is code inside pre</pre></code>
<pre>This is just pre</pre>
</body>
</html>
looks like this:
Looking at the above, my personal thought is that code
is a bit small with respect to normal text (more evident from inline code element). Actually it seems that monospace font is smaller than normal even when at same nominal size. I would probably get rid of the assumption.
from sakura.
Related Issues (20)
- Tables need spacing at the bottom
- Replace Sass @import usage with @forward
- Unexpected underline for image link when hovering
- Bookmark explenation HOT 1
- CSS Box Sizing Reset HOT 2
- <video> tag parent overflow HOT 1
- Add `prefers-color-scheme` to recognize dark mode HOT 4
- [Feature Request] Admonitions HOT 2
- Add Name IN Sakura List HOT 2
- [Feature Request] Alternate colors of rows in the table. HOT 1
- CSS version with var HOT 2
- Is there a fork of CSS w/ var and no SCSS? HOT 1
- owlofathena.com is no longer working HOT 1
- Improve tooling HOT 3
- Horizontal Line Style in Chrome
- Project url doesn't exists HOT 1
- Dark mode option.
- Use unique names for theme colors
- Confusing style of buttons after being clicked HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.