Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

How to customize styles? #198

Closed
PhucNgo1711 opened this issue Jun 16, 2021 · 10 comments
Closed

How to customize styles? #198

PhucNgo1711 opened this issue Jun 16, 2021 · 10 comments

Comments

@PhucNgo1711
Copy link

I'm trying to use this with React. I was able to set it up like this
https://codesandbox.io/s/vuerd-react-test-uzfld?file=/src/App.js

I see that there are these options to customize styles here
https://vuerd.github.io/vuerd/?path=/docs/example-demo--erd-editor

but I am not able to figure out how to actually use them in the code.

Any help is appreciated. Thanks!

@dineug
Copy link
Owner

dineug commented Jun 17, 2021

@Daybayzayd
Copy link

Is there a way to have different table background ?

For example One table with blue background (in the title for example), another with green background etc. ?

I would like to recognize different type of table directly with the color, like this :
https://drawsql.app/img/drawsql-screenshot-2.png

@PhucNgo1711
Copy link
Author

@dineug
Copy link
Owner

dineug commented Jun 21, 2021

Is there a way to have different table background ?

For example One table with blue background (in the title for example), another with green background etc. ?

I would like to recognize different type of table directly with the color, like this :
https://drawsql.app/img/drawsql-screenshot-2.png

There is no function at this time.
Function development is simple, so I'll add it.

@Daybayzayd

@PhucNgo1711
Copy link
Author

@dineug how do I overwrite some custom css?
Right now stuff like this is being ignored

.vuerd-table .vuerd-table-header-top .vuerd-button {
  height: 1em !important;
}

@dineug
Copy link
Owner

dineug commented Jun 22, 2021

I don't recommend it because it breaks the size calculation.

Here's how:
https://www.html5rocks.com/ko/tutorials/webcomponents/shadowdom-201/

@PhucNgo1711

@PhucNgo1711
Copy link
Author

I don't recommend it because it breaks the size calculation.

Here's how:
https://www.html5rocks.com/ko/tutorials/webcomponents/shadowdom-201/

@PhucNgo1711

Got it thanks! I was actually trying something else. The height was just a random example.

@PhucNgo1711
Copy link
Author

PhucNgo1711 commented Jun 22, 2021

@dineug So I was able to use the shadow DOM styling for something like, as an example, the body tag, but I still can't use it for .vuerd-table-button
https://codesandbox.io/s/vuerd-react-test-uzfld?file=/src/App.js

Did I miss something?

@dineug
Copy link
Owner

dineug commented Jun 22, 2021

I've tried a few things.
I don't think it's working.

To add a style to ShadowRoot, you must import ShadowRoot.

const shadowRoot = editor.shadowRoot;
shadowRoot.appendChild(style);

@PhucNgo1711

@Daybayzayd
Copy link

Daybayzayd commented Jun 22, 2021

Is there a way to have different table background ?
For example One table with blue background (in the title for example), another with green background etc. ?
I would like to recognize different type of table directly with the color, like this :
https://drawsql.app/img/drawsql-screenshot-2.png

There is no function at this time.
Function development is simple, so I'll add it.

@Daybayzayd

Thanks for the quick reply and thanks for your great tool ! :)
If the job is just modifying CSS class or dom object, maybe i can do this.

Repository owner locked and limited conversation to collaborators Dec 30, 2021
@dineug dineug converted this issue into discussion #266 Dec 30, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants