question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Apply a custom stylesheet/theme

See original GitHub issue

We should introduce an attribute named pdf-style (or maybe use the stylesheet and stylesdir attributes ?) to provide a custom stylesheet.

I think the default style should be named default.css and we should support the @import directive. The idea is to be able to extend the default style:

@import 'default.css';

.role.red {
  color: #ff0000;
}

To avoid path resolution issues, we will probably need to replace the directive with the actual content. default.css will be a reserved name.

It should also be possible to use @import to include stylesheets:

color.css

:root {
  --main-color: #2b2d2f;
}
@import 'default.css';
@import 'color.css';

.paragraph {
  color: var(--main-color);
}

.title {
  color: var(--main-color);
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:22 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
mojavelinuxcommented, Sep 9, 2019

Using a CSS framework is just not a good way to maintain this stylesheet long term.

The reason I say this is because when the framework gets updated, it changes in so many ways that you waste tons of time just trying to figure out what broke. So all the gains you had from the framework are lost. The frameworks are great for rapid prototyping, but aren’t good for long term maintenance (which is our use case).

1reaction
Mogzttercommented, Sep 9, 2019

The frameworks are great for rapid prototyping, but aren’t good for long term maintenance (which is our use case).

I couldn’t agree more 👍

It’s better to hand craft it. I find PostCSS to be perfect for this (which is just regular CSS with polyfills).

I do have a prototype (still based on Sass and foundation though it’s not a dependency anymore): https://github.com/Mogztter/asciidoctor-stylesheets

The plan is to use a new approach for the new semantic HTML 5 converter or do you also want to use this new approach on the existing/current HTML 5 converter ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apply a custom stylesheet/theme · Issue #60
We should introduce an attribute named pdf-style (or maybe use the stylesheet and stylesdir attributes ?) to provide a custom stylesheet.
Read more >
Style Sheet Theme Name | ASP.NET Web Forms Controls
This option specifies the name of a default or custom style sheet theme to be applied to all DevExpress controls within a website....
Read more >
StyleSheetTheme in Custom Controls - MSDN - Microsoft
Hi ! I'm creating a new custom web control and I'm trying to apply stylesheetTheme to this control. Evertything works fine in runtime,...
Read more >
Creating a Stylesheet Theme
To create a stylesheet theme, you need to first create your custom ... will show you how to package up your stylesheet for...
Read more >
Set StyleSheetTheme in @Page directive in ASP.NET
PRR.WEB.CurrentSession.Theme' cannot be found in the application or global theme directories. How can I implement this ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found