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

[PLUGIN] Is there a way to attach a new external css to my custom plugin ? #279

Open
RaspFR opened this issue Sep 9, 2019 · 3 comments
Open

Comments

@RaspFR
Copy link

RaspFR commented Sep 9, 2019

Hi Xzandro,
I've developped a swex plugin about guild ranking that acutally print in the log a table of all my guildies sorted by overall contribution. (see screenshot attached).

I can make it as beautiful as I want because I was unable to attached to my plugin js file an external css that I've created in the same folder. And I don't want to inject complex css in every html style attribute...

So my question is : Is there a way to do it or do you have to improve the swex plugins system to make it possible ?

contrib

Thanks a lot for your great work ;)

@Xzandro
Copy link
Owner

Xzandro commented Oct 12, 2019

I don't think you can utilize additional CSS other than what's provided by semantic-ui. Your best bet is probably dump a custom HTML like file and do all styling there, or create an external website and post all your data to this service. The Log section isnt really made to post in highly complex and styled data.

@Artenuvielle
Copy link

I'd suggest exposing the BrowserWindow class from electron to plugins as third parameter for init as done in #305.
This way plugins can handle their own windows for display and have links to css files in there.

@Artenuvielle
Copy link

While providing the BrowserWindow class to the plugins from SWEX would work you can also get the constructor for BrowserWindow from the globally registered 'win' variable which holds the electron main window of SWEX. Since its constructor is not accessible by the instance itself you have to access proto for that. Example:

    new global.win.__proto__.constructor({  // BrowserWindow constructor options here
        x: 100,
        y: 100,
        minWidth: 1800,
        minHeight: 906
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants