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

Include Node type as a data attribute in the node's div declaration so that it can be selected and styled in CSS #187

Open
canxerian opened this issue Sep 16, 2022 · 3 comments

Comments

@canxerian
Copy link
Contributor

It would be very useful to include the node type as defined in the config as a data attribute to the node's HTML representation, as demonstrated:

Example config:

config.addNodeType({
    type: "HomePageContent",
    label: "Home Page",
    description: "Content for the home page",
    initialWidth: 260,
    inputs: ports => [
        // input ports
    ],
    outputs: ports => [
        // output ports
    ]
})

Current Flume generated HTML:

<div 
    class="Node_wrapper__3SmT7" 
    data-node-id="x0a5MUHqGM"
    data-flume-component="node">

Desired HTML:

<div 
    class="Node_wrapper__3SmT7"       
    data-node-type="HomePageContent"  <!-- Add "data-node-type" attribute -->
    data-node-id="x0a5MUHqGM"
    data-flume-component="node">
@chrisjpatty
Copy link
Owner

Nice, yeah that's a good idea should be easy to add. As soon as I get the typescript rewrite stable I'll add that.

@canxerian
Copy link
Contributor Author

canxerian commented Sep 17, 2022

Thanks for your reply @chrisjpatty!

It's looks like a task I can do - is there a guide on how to contribute to this repo? I checked out the source code but couldn't figure out how to build.

@canxerian
Copy link
Contributor Author

Figured it out in the end and was able to test my change locally (using yarn install && yarn build && npm pack). PR submitted

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

2 participants