Skip to content
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

Feature Request: Add ability to select between multiple styles #135

Closed
jmcd040 opened this issue Mar 1, 2024 · 7 comments
Closed

Feature Request: Add ability to select between multiple styles #135

jmcd040 opened this issue Mar 1, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@jmcd040
Copy link

jmcd040 commented Mar 1, 2024

First, your plugin is a great addition to Obsidian. Thank you.
Before finding Obsidian, I was using Typora. I created several "Themes" in Typora where the only difference was the style of the PDF export.
I have a style for editing that has a wide right margin and larger line height.
Then I have a style for publishing.
I also have a style that I call "Speaker Script" which has a large font and more distinctive colors for headings. I use this last one as my script when giving a lecture.
Each style has other variations as well.
Having a css file for each style allows me the flexibility I need. So at the moment, I'm using your plugin for printing a script for simple editing, but use Typora to access my specially developed styles.

It would be nice if your plugin allowed for the selection of different css files for styling. You could allow the user to select a default one, then on the preview screen allow additional selections before finally exporting.
Thanks
-Jim

@l1xnan l1xnan added the enhancement New feature or request label Mar 4, 2024
@l1xnan
Copy link
Owner

l1xnan commented Mar 4, 2024

I don't know how your current CSS styles are defined. I think one solution would be to add a rootClass option and your CSS code snippet could be defined as.

.rootClassA .tag_class {
    xxxx
}

.rootClassB .tag_class {
    xxxx
}
...

This className can be dynamically populated into <body class="rootClassA'... ` to achieve dynamic style selection. It may require you to make some adjustments to your own style.

I don't know if that meets your expectations?

@l1xnan
Copy link
Owner

l1xnan commented Mar 10, 2024

@jmcd040 Obsidian supports the cssclasses attribute allows you to style individual notes using CSS snippets. See the document: https://help.obsidian.md/Editing+and+formatting/Properties#Default+properties
You can do this with it.

@jmcd040
Copy link
Author

jmcd040 commented Mar 12, 2024

I only want to style the PDF, not the note. I want to select the particular PDF style according to its purpose when I generate the PDF. Currently, using Typora, I have several different "themes." Each one leaves the document/note format alone, but changes the @media print{} css. I was hoping your plugin would allow me to select a css file that contained the @media print{} I need for that PDF export.
It sounds like you solution is to modify the cssclasses property before exporting. Is that right?

@l1xnan
Copy link
Owner

l1xnan commented Mar 13, 2024

Currently, this feat can be achieved by modifying the cssclasses attribute. If we want a selection entry point on the interface, I haven't figured out how to present it yet. Do you have any good suggestions?

@jmcd040
Copy link
Author

jmcd040 commented Mar 24, 2024 via email

@l1xnan
Copy link
Owner

l1xnan commented Mar 25, 2024

Thank you for your suggestion, I will try to see if I can access the inactive CSS snippet file.

@l1xnan
Copy link
Owner

l1xnan commented May 7, 2024

image
I released version 1.8.0, which contains the relevant changes, and you need to turn on the configuration, which you can select in the preview modal
image

@l1xnan l1xnan closed this as completed May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants