Comments (4)
Hey @agrawal-rohit,
you can overwrite the CSS via:
.react-flow__controls-button {
width: 16px;
height: 16px;
}
from react-flow.
@moklick That worked, thank you so much for the quick response! Great library by the way :)
from react-flow.
Hello, I am having some issues with adding styles on the controls object - even the simpler example above isn't working for me. This is the CSS I am adding
Dag.css:
.react-flow__controls {
display: flex;
justify-content: space-between;
position: absolute;
z-index: 5;
top: 20px;
left: calc(50% - 200px);
height: 50px;
width: 400px;
background-color: white;
border: 1px solid darkgray;
border-radius: 5px;
}
.react-flow__controls-button{
width: 40px;
height: 40px;
border: none;
background-color: white;
border-radius: 5px;
}
.react-flow__controls-button svg {
max-height: 20px;
max-width: 20px;
}
And in my Dag.js file, I import my Dag.module.css for my CSS modules as well as the above Dag.css file.
which when I run npm start
in test mode, it appears to be working correctly:
But when I deploy a site using npm run build
I am getting this:
Inlining the styles directly in the Controls
and ControlButton
is working slightly better, but I am now missing the gray-on-hover effect and can't inline that selector. I suspect this is due to the default and theme styles being injected into <head/>
in a different order during the build step than how local mode works. Going for the nocss
option seems like overkill since I just want to override a couple styles - I presume I'm doing something wrong here.
I am using CRA, react
18.2, and react-flow-renderer
10.3.14. Thank you in advance!
from react-flow.
try to strengthen the selector with .react-flow
:
.react-flow .react-flow__controls {
display: flex;
justify-content: space-between;
position: absolute;
z-index: 5;
top: 20px;
left: calc(50% - 200px);
height: 50px;
width: 400px;
background-color: white;
border: 1px solid darkgray;
border-radius: 5px;
}
.react-flow .react-flow__controls-button {
width: 40px;
height: 40px;
border: none;
background-color: white;
border-radius: 5px;
}
.react-flow .react-flow__controls-button svg {
max-height: 20px;
max-width: 20px;
}
Does this work?
from react-flow.
Related Issues (20)
- Error when clicking edge source end with onReconnect HOT 2
- NodeResizer lineStyle boderStyle invalid HOT 5
- Documentation website UX issue HOT 3
- `useStore` hook doesn't respect `ReactFlowState` generic HOT 2
- How can i prevent or stop the mouse event when i render the three.js model in reactflow HOT 9
- Floating Edges Example have some issue HOT 1
- useUpdateNodeInternals doesnot update node dimensions on dynamic increase of handles HOT 4
- Setting nodeExtent prevents group panning. HOT 2
- orientation prop missing on Control component HOT 2
- Node thumbnails are not displayed in MiniMap HOT 1
- Can't test ReactFlow in vitest HOT 1
- On hooks page for useKeyPress, a row inside Signature is not L HOT 2
- Moving a part of diagram is not working properly for Edited edges points HOT 1
- Calling `getNodes` does not return new added nodes using `addNodes` HOT 4
- Can the Interactive button be set to default true or false? HOT 1
- Node resizing with onResizeEnd not working on iPad HOT 1
- [v12] getMarkerEnd not exported HOT 6
- Connecting edges creates erroneous duplicate edges when selectionOnDrag=true HOT 4
- ReactFlow v12 - class `nodrag` doesn't prevent selection as it did in previous versions HOT 2
- Make ViewportPortal a ForwardRef Component
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-flow.