Porównaj commity

...

5 Commity

Autor SHA1 Wiadomość Data
Konnor Rogers e17169b3fa
Merge branch 'next' into konnorrogers/fix-split-panel-hidden-to-show 2024-04-11 13:53:09 -04:00
Konnor Rogers a427433701
fix: scrollbar gutters and dialog scrolling on open (#1967)
* fix: scrollbar gutters and dialog scrolling on open

* prettier

* fix check for current scrollbarGutter property

* prettier
2024-04-11 13:52:41 -04:00
Konnor Rogers 18819ba066
Merge branch 'next' into konnorrogers/fix-split-panel-hidden-to-show 2024-04-11 13:50:55 -04:00
Danny Andrews c6da4f5b14
Update docs for customizing button widths (#1973)
Currently, the docs state that you can set a width attribute to
customize the width of buttons, but no such attribute exists. I've
updated the docs to direct people to set a custom width via CSS through
inline styles or a custom class.
2024-04-11 12:32:54 -05:00
Cory LaViska d0b71adb81
update tooltip styles; fixes #1947 (#1948) 2024-03-28 11:01:21 -04:00
5 zmienionych plików z 23 dodań i 3 usunięć

Wyświetl plik

@ -236,7 +236,7 @@ When a `target` is set, the link will receive `rel="noreferrer noopener"` for [s
### Setting a Custom Width
As expected, buttons can be given a custom width by setting the `width` attribute. This is useful for making buttons span the full width of their container on smaller screens.
As expected, buttons can be given a custom width by passing inline styles to the component (or using a class). This is useful for making buttons span the full width of their container on smaller screens.
```html:preview
<sl-button variant="default" size="small" style="width: 100%; margin-bottom: 1rem;">Small</sl-button>

Wyświetl plik

@ -14,7 +14,9 @@ New versions of Shoelace are released as-needed and generally occur when a criti
## Next
- Fixed a bug in `<sl-split-panel>` that caused it not to recalculate it's position when going from being `display: none;` to its original display value. [#]
- Fixed a bug in `<sl-split-panel>` that caused it not to recalculate it's position when going from being `display: none;` to its original display value. [#1942]
- Fixed a bug in `<dialog>` where when it showed it would cause a layout shift. [#1967]
- Fixed a bug in `<sl-tooltip>` that allowed unwanted text properties to leak in [#1947]
## 2.15.0

Wyświetl plik

@ -44,6 +44,8 @@ export default css`
font-size: var(--sl-tooltip-font-size);
font-weight: var(--sl-tooltip-font-weight);
line-height: var(--sl-tooltip-line-height);
text-align: start;
white-space: normal;
color: var(--sl-tooltip-color);
padding: var(--sl-tooltip-padding);
pointer-events: none;

Wyświetl plik

@ -33,6 +33,19 @@ export function lockBodyScrolling(lockingEl: HTMLElement) {
if (!document.documentElement.classList.contains('sl-scroll-lock')) {
/** Scrollbar width + body padding calculation can go away once Safari has scrollbar-gutter support. */
const scrollbarWidth = getScrollbarWidth() + getExistingBodyPadding(); // must be measured before the `sl-scroll-lock` class is applied
let scrollbarGutterProperty = getComputedStyle(document.documentElement).scrollbarGutter;
// default is auto, unsupported browsers is "undefined"
if (!scrollbarGutterProperty || scrollbarGutterProperty === 'auto') {
scrollbarGutterProperty = 'stable';
}
if (scrollbarWidth <= 0) {
// if there's no scrollbar, just set it to "revert" so whatever the user has set gets used. This is useful is the page is not overflowing and showing a scrollbar, or if the user has overflow: hidden, or any other reason a scrollbar may not be showing.
scrollbarGutterProperty = 'revert';
}
document.documentElement.style.setProperty('--sl-scroll-lock-gutter', scrollbarGutterProperty);
document.documentElement.classList.add('sl-scroll-lock');
document.documentElement.style.setProperty('--sl-scroll-lock-size', `${scrollbarWidth}px`);
}

Wyświetl plik

@ -6,7 +6,10 @@
@supports (scrollbar-gutter: stable) {
.sl-scroll-lock {
scrollbar-gutter: stable !important;
scrollbar-gutter: var(--sl-scroll-lock-gutter) !important;
}
.sl-scroll-lock body {
overflow: hidden !important;
}
}