Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the z-index management open for the developers #5352

Open
oleq opened this issue Apr 25, 2017 · 4 comments
Open

Make the z-index management open for the developers #5352

oleq opened this issue Apr 25, 2017 · 4 comments
Labels
package:ui status:discussion support:2 An issue reported by a commercially licensed client. type:improvement This issue reports a possible enhancement of an existing feature.

Comments

@oleq
Copy link
Member

oleq commented Apr 25, 2017

ATM we use a ck-z mixin to configure the z-index in the project. The problem is that developers may find them wrong, e.g. because they collide with other web page elements like modals, overlays, etc. but there's no easy way to change them.

Solution 1

Use the power of SASS !default and do something similar to what we did with colors.

Pros:

  • Developers can easily change the z-index map to their preferred values.

Cons:

  • Devs need to (re–)compile editor and the styles to do this, which requires the entire dev env.
  • There's no way to change the values with vanilla CSS.
    • The values are dispersed across the code base. E.g. ck-z( 'modal' ) can be used in many places in the code, and devs who will fight it will need to override dozens of unrelated selectors to get their correct value right.
  • For the same reason, there's no way to control it with JS.

Solution 2

Switch to class-driven z-index management. The SASS helper will generate a set of classes like .ck-z_default, .ck-z_modal, with pre-defined values, which then will be used in the templates to assign the desired index.

Pros:

  • It's enough to .ck-z_modal { z-index: my value } in the custom styles sheet to override the z-index for the entire project.
    • It's easy to control such styles with JS, if there's such a need.
  • Solution 1 still works. If developers decide they don't want to play with custom styles but re-compile the editor (which is a dependency in Webpack), they can override the default map containing z-index values so that generated classes (.ck-z_default, .ck-z_modal, ... ) represent the right values.
  • It's still possible to create styles silently via .foo { @extend .ck-z_modal }, like .foo { z-index: ck-z( 'modal' ) }

Cons:

  • We need to extend a couple of templates in the JS code, to make them use .ck-z_* classes.
@Reinmar
Copy link
Member

Reinmar commented Jun 22, 2017

@Reinmar
Copy link
Member

Reinmar commented Oct 3, 2017

@mlewand mlewand transferred this issue from ckeditor/ckeditor5-ui Oct 9, 2019
@mlewand mlewand added this to the backlog milestone Oct 9, 2019
@mlewand mlewand added status:discussion type:improvement This issue reports a possible enhancement of an existing feature. package:ui labels Oct 9, 2019
@otherblandart
Copy link

otherblandart commented Jun 23, 2020

Any plans to move forward with this? In our implementation we render editors inside containers and give them a max height, but this makes balloon toolbars and certain dropdown menus float above other, outer content when editor content is taller than max-height.
image

FYI, this can also be seen in the Document Editor demo:
image

@oleq
Copy link
Member Author

oleq commented Jul 6, 2020

@otherblandart What you described is a different issue not related to z-indexes. Give it a thumbs up if you want to see it fixed. Thanks!

@pomek pomek removed this from the backlog milestone Feb 21, 2022
@aldonace-wu aldonace-wu added the support:2 An issue reported by a commercially licensed client. label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:ui status:discussion support:2 An issue reported by a commercially licensed client. type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

No branches or pull requests

6 participants