Skip to content

Switch Composable Gets Clipped When Using Bootstrap CSS #631

@masah517

Description

@masah517

YOUR BUG DESCRIPTION HERE

If relevant, specify:

  • OS: M1 Mac
  • Kobweb libs version: "0.20.0"
  • Kobweb CLI version: 0.9.18

Steps to Reproduce

  1. Import the Bootstrap 5 CSS in the module level build.gradle.kts.
<link 
    rel="stylesheet" 
    href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
/>
  1. Use the Silk Switch Composable
Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
        //Text("THIS PAGE INTENTIONALLY LEFT BLANK")
        Switch(
            checked = true,
            onCheckedChange = {},
            size = SwitchSize.LG,
        )
    }
  1. Observe the size of the Switch.

Expected Behavior

The Switch should render correctly at its default size of 46px × 24px as shown when Bootstrap is not included.
(the SwitchSize.LG is used, and the default text size of my Chrome browser is 16.px)

スクリーンショット 2024-12-16 15 27 41

Actual Behavior

The size of the Switch gets clipped down to 39.984px × 17.984px when Bootstrap CSS is included, as attached screenshot below.
スクリーンショット 2024-12-16 15 27 25

Additional Context

I have prepared the basic project that can reproduce the above issue, so please kindly refer to it if required.
https://github.com/masah517/SwitchKobwebDemo

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions