SingleFile icon indicating copy to clipboard operation
SingleFile copied to clipboard

Add options to customize the look of SingleFile by injecting custom stylesheets

Open dnknn opened this issue 5 years ago • 17 comments

Can support to custom CSS/Style of annotation-editor page ?

  • Implementation plan/UI: 👇 image

For SingleFile, custom CSS should only be on the annotation-editor page, If custom CSS can be supported , the users can customize the toolbar style ... or .single-file-cut-hover, .single-file-cut-outer-hover, .single-file-remove-highlights-mode .single-file-highlight:hover etc. ...

Like many other extensions that provides an option for custom CSS

2011_25033152 2011_25033322

dnknn avatar Nov 24 '20 19:11 dnknn

Well, I'm wondering how many users would use this feature.

gildas-lormeau avatar Nov 24 '20 20:11 gildas-lormeau

Well, I'm wondering how many users would use this feature.

May not use it but cannot be without :) In fact, it should be said: of course, this feature belongs to advanced users who understand CSS, or of course, they can share CSS with others people, but the important point is that SingleFile have already enough users , so there maybe potential demand in it.

dnknn avatar Nov 24 '20 21:11 dnknn

May not use it but cannot be without :)

SingleFile is open-source, anyone can fork it, change what he does not like, and send me a pull request or even publish his fork.

Out of curiosity, what changes would you apply if you could inject styles (easily)?

gildas-lormeau avatar Nov 24 '20 21:11 gildas-lormeau

^_^ I personally don’t understand any language code/programming except CSS (because the basic CSS does not require logic, the threshold is very low.)...so... The default styles of SingleFile are standard and universal, applicable to all users, no problems at all, and my changes only more suitable for myself. because now is no CSS customization, I didn't think about how to change the appearance style for me. For example, increase the spacing between several commonly used toolbar buttons, e.g. ... .note {font-size:17px} etc., if it is realized, I will share it after writing it.

dnknn avatar Nov 24 '20 21:11 dnknn

Thank you for the feedback. I think that if I implement this feature, I wouldn't restrict it to the annotation editor. It might also be interesting to inject styles in the UI elements of SingleFile (the progress bar, the log panel, the shadow on the document), and maybe change the icon too.

gildas-lormeau avatar Nov 24 '20 21:11 gildas-lormeau

I wouldn't restrict it to the annotation editor. It might also be interesting to inject styles in the UI elements of SingleFile (the progress bar, the log panel, the shadow on the document), and maybe change the icon too.

This feature can actually be used to create/share different(many different types of) UI-themes. 💪👍You are right, that's great/perfect! That is the best/good for consistency!

dnknn avatar Nov 25 '20 08:11 dnknn

Well, I'm wondering how many users would use this feature.

I'm extremely interested in this feature, especially for CLI capture. I can hide a lot of elements I deem to be clutter when looking through the archived pages.

God-damnit-all avatar Dec 06 '20 02:12 God-damnit-all

@ImportTaste You're not referring to the same feature. The purpose of this feature is not to modify the style of the saved page. What you want to achieve is already possible by using the option --browser-script. You can use it to inject a script that would in its turn inject in JavaScript an inline stylesheet stored as a string.

gildas-lormeau avatar Dec 06 '20 19:12 gildas-lormeau

@ImportTaste I added an option --browser-stylesheet to inject a stylesheet after the page is loaded.

gildas-lormeau avatar Dec 06 '20 21:12 gildas-lormeau

@ImportTaste I added an option --browser-stylesheet to inject a stylesheet after the page is loaded.

You're awesome. Thank you.

God-damnit-all avatar Dec 06 '20 21:12 God-damnit-all

I added an option --browser-stylesheet to inject a stylesheet after the page is loaded.

Excuse me, how to use option --browser-stylesheet ?

dnknn avatar Dec 07 '20 01:12 dnknn

It works similarly to --browser-script. You can for example create a file named my-stylesheet.css which would contains the rules you would like to apply before the page is saved and run single-file https://www.example.com --browser-stylesheet=my-stylesheet.css.

gildas-lormeau avatar Dec 07 '20 11:12 gildas-lormeau

I added an option --browser-stylesheet

for the latest repo, I want to try, but can't find this option.

create a file named my-stylesheet.css

I see.

single-file https://www.example.com --browser-stylesheet=my-stylesheet.css

I don't understand this sentence,
Do you mean to open single-file https://www.example.com --browser-stylesheet=my-stylesheet.css in the browser's address bar? have you written relevant help documents, or examples.

dnknn avatar Dec 07 '20 12:12 dnknn

I added an option --browser-stylesheet

for the latest repo, I want to try, but can't find this option.

I confirm you have to update the code

single-file https://www.example.com --browser-stylesheet=my-stylesheet.css

I don't understand this sentence, Do you mean to open single-file https://www.example.com --browser-stylesheet=my-stylesheet.css in the browser's address bar? have you written relevant help documents, or examples.

I'm referring to SingleFile launched from the command line interface instead of running as an extension, see https://github.com/gildas-lormeau/SingleFile/tree/master/cli

gildas-lormeau avatar Dec 07 '20 12:12 gildas-lormeau

launched from the command line

Aha. I don't understand those complicated ones, thanks for your reply.

dnknn avatar Dec 07 '20 13:12 dnknn

It may sound complicated but it's not so complicated if you follow the manual installation procedure for example.

gildas-lormeau avatar Dec 07 '20 13:12 gildas-lormeau

There is still some hope it will be implemented, I hope won't take 8 years though.

gildas-lormeau avatar Jun 09 '21 19:06 gildas-lormeau