Giter VIP home page Giter VIP logo

Comments (4)

JonDum avatar JonDum commented on June 23, 2024 1

Best way of handling it would be a classes prop that allows you to pass in what css class you want.

<PanelGroup classes={{divider: 'my-divider', panel: 'whoopwhoop'}}/>

This works really well with css-modules too.

.divider {
  background: blue;
}
import classes from './styles.css'
....
<PanelGroup classes={classes}/>

from react-panelgroup.

DDN-Shep avatar DDN-Shep commented on June 23, 2024

This is something I would like too, although for a slightly different reason.

If a panelWidth resize is set to "fixed", the cursor for the divider is still set to "row-resize" or "column-resize" depending on the direction.

Ideally, the cursor should not change to indicate that resize is possible when it is not.

However, having the ability to propagate our own styles or classes to each panel would enable us to solve this ourselves.

Perhaps something like;

<PanelGroup direction='column' borderColor: '#333' panelWidths={ [
  { size: 28, resize: 'fixed', className: 'example-fixed-panel' }, 
  { resize: 'dynamic' }] 
}>
  <div>Fixed Panel with no resize cursor on the divider</div>
  <div>Dynamic Panel</div>
</PanelGroup>

from react-panelgroup.

DrewMcArthur avatar DrewMcArthur commented on June 23, 2024

bump, with the addition that the divider currently has style directly in the element. It'd be a lot better to have it defined in a separate CSS file, so that way it could be overwritten by my own css. as it stands, i think i'd have to use !important or fork my own panel group.

from react-panelgroup.

amandakoster avatar amandakoster commented on June 23, 2024

Best way of handling it would be a classes prop that allows you to pass in what css class you want.

<PanelGroup classes={{divider: 'my-divider', panel: 'whoopwhoop'}}/>

This works really well with css-modules too.

.divider {
  background: blue;
}
import classes from './styles.css'
....
<PanelGroup classes={classes}/>

Hi@JonDum, CSS/Styles sheet worked for color though not width, and trying to override the styles with jss and no luck. Any ideas?

import withStyles from '@material-ui/core/styles/withStyles';
import React from 'react';
import ReactPanelGroup from 'react-panelgroup';

// import classes from './styles.css';

const styles = {
  divider: {
    width: 3,
    background: 'green !important',
    '&:hover': 'pink',
  },
};

const PanelGroup = ({ children, classes }) => {
  return (
    <ReactPanelGroup
      classes={{
        divider: classes.divider,
      }}
    >
      {children}
    </ReactPanelGroup>
  );
};

export default withStyles(styles)(PanelGroup);

from react-panelgroup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.