Skip to content
This repository has been archived by the owner on Dec 23, 2022. It is now read-only.

Outlined variant styling issues #241

Closed
mezzode opened this issue Oct 20, 2018 · 1 comment
Closed

Outlined variant styling issues #241

mezzode opened this issue Oct 20, 2018 · 1 comment
Assignees
Labels

Comments

@mezzode
Copy link
Contributor

mezzode commented Oct 20, 2018

There are some style issues when using the outlined variant.

  • fullWidth doesn't work. It appears to be applying width: 100% to the wrong node meaning that the input itself isn't full width.
  • Label is not vertically aligned when using dense margin. With the dense margin, the label is 2px offset.

image

Currently I'm working around the issue by overriding the styles:

const styles = createStyles({
    // chipInput works around fullWidth bug with outlined variant ChipInput
    chipInput: {
        width: '100%',
    },
    // chipLabel and chipLabelShrink work around label vertical alignment bug
    // with dense margin ChipInput
    chipLabel: {
        '&:not($chipLabelShrink)': {
            top: '-2px !important',
        },
        top: '2px !important',
    },
    chipLabelShrink: {
        top: '0px !important',
    },
});
...
<ChipInput fullWidth={true} margin="dense" classes={{
    inputRoot: classes.chipInput,
    label: classes.chipLabel,
    labelShrink: classes.chipLabelShrink,
  }}
/>
@leMaik
Copy link
Member

leMaik commented Jul 28, 2019

Finally fixed this. 🎉

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

No branches or pull requests

2 participants