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

Breakpoint indicator label #40927

Open
2 tasks done
tugrul opened this issue Oct 9, 2024 · 0 comments
Open
2 tasks done

Breakpoint indicator label #40927

tugrul opened this issue Oct 9, 2024 · 0 comments

Comments

@tugrul
Copy link

tugrul commented Oct 9, 2024

Prerequisites

Proposal

Actually I use following snipped in my projects to figure out which breakpoint is active on viewport. It would be nice opt-in feature like Sass mixin or utility class.

body.breakpoints-label {
  &:before {
    @include border-radius();
    content: "no";
    position: fixed;
    left:2px;
    top:2px;
    padding: 2px 4px;
    font-size:12px;
    line-height: 1em;
    color: var(--bs-danger-text-emphasis);
    background-color: var(--bs-danger-bg-subtle);
    border: 1px solid var(--bs-danger-border-subtle);
    z-index: 100;
    opacity:0.4;

    @each $name, $size in $grid-breakpoints {
      @media (min-width: $size) {
        content: "#{$name}";
      }
    }
  }
}

Motivation and context

It is hard to understand which breakpoint is active on development phase and it increase development speed when we see active breakpoint's name in the label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants