feat(slider): add fullWidth prop (#1354)

The `bx--slider` class in the `Slider` component has max-width of `40rem`. Because `$$restProps` is spread to the top-level `div` element in `Slider`, the only way to override the style is to do so globally:

```css
:global(.bx--slider-container) {
  width: 100%;
}

:global(.bx--slider) {
  max-width: none;
}
```

This adds a `fullWidth` prop that sets a full width style using inline style attributes.
This commit is contained in:
metonym 2022-06-18 12:47:10 -07:00 committed by GitHub
commit 1ccdf64504
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 57 additions and 20 deletions

View file

@ -11074,6 +11074,18 @@
"constant": false,
"reactive": false
},
{
"name": "fullWidth",
"kind": "let",
"description": "Set to `true` for the slider to span\nthe full width of its containing element.",
"type": "boolean",
"value": "false",
"isFunction": false,
"isFunctionDeclaration": false,
"isRequired": false,
"constant": false,
"reactive": false
},
{
"name": "id",
"kind": "let",

View file

@ -11,6 +11,12 @@ components: ["Slider", "SliderSkeleton"]
<Slider />
### Full width
Set `fullWidth` to `true` for the slider to span the full width of its containing element.
<Slider fullWidth />
### Hidden text input
<Slider hideTextInput />