Usecases for --stylesheet vs. --css handling in the HTML template
See original GitHub issueInitially, the HTML template received the path for the stylesheet (either the default one, or a custom one provided with the --stylesheet
option):
With the introduction of the --css
option, I changed it to:
And deprecated the passing of the stylesheet
property to the template.
However, I think I might have missed a valid use-case for an external stylesheet, namely being able to reference outside resources (images, web fonts) in the custom CSS.
This issue outline some use-cases, to make sure the final solution covers all of them elegantly:
- Override just the page size, margins, font sizes
- Override the default stylesheet with a custom one
- Use local web fonts in the custom stylesheet
(Adding to this list as more use-cases arise)
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Style Sheets in HTML documents - W3C
In many cases, authors will take advantage of a common style sheet for a group of documents. In this case, distributing style rules...
Read more >Styled Components vs. CSS Stylesheets - GetStream.io
There's a hot debate around standard CSS stylesheets vs. “CSS-in-JS” solutions when building in modern front-end frameworks.
Read more >Organizing your CSS - Learn web development | MDN
I mentioned above that one way to organize CSS is to break down stylesheets into smaller stylesheets. When using Sass you can take...
Read more >What are CSS Modules and why do we need them?
CSS files in which all class names and animation names are scoped locally by default. So CSS Modules is not an official spec...
Read more >External CSS Stylesheets – How to Link CSS to HTML and ...
It is considered a best practice to have your CSS stylesheets in an external file. So how can you link that CSS to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oops, missed your comment here. Yes, you can set it on the html element. Also, I’ll add in the docs how to use the CSS variables
--body-font
and--alt-font
.This works well with the
--css
option.This works via the
--style
option.For PDFs and HTMLs you can either reference fonts by name with
local()
, or use their absolute path on disk. EPUBs currently don’t fetch these fonts to bundle them, but that’s okay.I think we can close the issue for now.