question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ion-split-pane: expose max-width as CSS custom property

See original GitHub issue

Feature Request

Ionic version:

[x] 4.x

Describe the Feature Request

I want to be able to adjust the max width of the ion-split-pane side menu.

Describe Preferred Solution

Have a --max-width CSS custom property on ion-split-pane. Might be as simple as changing

{ max-width: $split-pane-md-side-max-width; }

to

{ max-width: var(--max-width, $split-pane-md-side-max-width); }

Describe Alternatives

Only way to currently make it work is to set

.menu-pane-visible {
  max-width: 270px !important;
}

which applies only for the expanded version. If max-width is set on the ion-menu, it messes up the backdrop for the collapsed version.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
troyanskiycommented, Jan 31, 2019

@brandyscarney PR is here.

1reaction
brandyscarneycommented, Jan 14, 2019

I agree with this. We will need to scope/shadow the split-pane component though. It seems as if the current CSS won’t even work for IE since it has a CSS variable for border. It will need to be something like the following (not tested):

split-pane.md.scss

:host {
  --min-width: #{$split-pane-md-side-min-width};
  --max-width: #{$split-pane-md-side-max-width};
}

:host(.split-pane-visible) .split-pane-side {
  --border: #{$split-pane-md-side-start-border};
}

:host(.split-pane-visible) .split-pane-side[side=end] {
  --border: #{$split-pane-md-side-end-border};
}

split-pane.scss

:host(.split-pane-visible) .split-pane-side {
  min-width: var(--min-width);
  max-width: var(--max-width);

  border: var(--border);
}

Might need to change up the border implementation, but just an idea. cc @manucorporat

Read more comments on GitHub >

github_iconTop Results From Across the Web

ion-split-pane: expose max-width as CSS custom property
I want to be able to adjust the max width of the ion-split-pane side menu. Describe Preferred Solution. Have a --max-width CSS custom...
Read more >
ion-split-pane - Ionic Framework
ion -split-pane is useful when creating multi-view app layouts. It allows UI elements, like menus, to be displayed as the viewport width increases....
Read more >
Change both menu width for ionic side menu - Stack Overflow
Use a class name to change the width of the side menu. In CSS you can use like below. Px is good but...
Read more >
signature=66f622bb021bc21706bd834efb86a377,ionic-framework ...
card: expose global card css variables (#21756) (096eef4), closes #21694 ... split-pane: convert to shadow component, add width, max-width, and min-width ...
Read more >
Untitled
Banditti di praga text, Nobuo at teeter house phoenix az, Revdev llc, ... Img max width not working in firefox, Trybson warsaw shore...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found