TheComputerM / svelte-materialify

A Material UI Design Component library for Svelte heavily inspired by vuetify.
https://svelte-materialify.vercel.app
MIT License
622 stars 84 forks source link

Buttons in ButtonGroup don't correctly connect #141

Open microdou opened 3 years ago

microdou commented 3 years ago

Issue:

Buttons in ButtonGroup don't correctly connect.

Screenshot:

image

How to Reproduce:

https://github.com/microdou/svelte-test/tree/svelte-materialify-buttongroup

git clone -b svelte-materialify-buttongroup https://github.com/microdou/svelte-test
cd svelte-test
npm i
npm run dev

# Then open up browser at http://localhost:5000

Browsers:

The issue exists on both Firefox & Chrome.

betaboon commented 3 years ago

my initial research: this seems to be due to both .s-btn and .s-btn-group-item applying to the elements and sometimes .s-btn takes precedence (most likely due to ordering in the final css-file).

workaround:

:global(.s-btn-group-item) {
  border-radius: 0 !important;
}
:global(.s-btn-group-item:first-child) {
  border-top-left-radius: inherit !important;
  border-bottom-left-radius: inherit !important;
}
:global(.s-btn-group-item:last-child) {
  border-top-right-radius: inherit !important;
  border-bottom-right-radius: inherit !important;
}