Coder Social home page Coder Social logo

Comments (1)

WOLFRIEND avatar WOLFRIEND commented on April 27, 2024

I've investigated this issue, and found that this performance problem is caused by this line of code

bootstrap/scss/_reboot.scss

Lines 506 to 508 in 4dcc376

+ * {
clear: left; // 2
}
:

legend {
  // Omitted piece of code...
  + * {
    clear: left; // 2
  }
  // Omitted piece of code...
}

This line was added as a fix in the following pull request: #30345. It fixes bug/behavior when leading elements after the legend are rendered in one line. Example link could be found in the following comment (after opening scroll it horizontally): #29712 (comment).
But, this bug/behavior is caused by the another pull request: #28917 where the following line of code has been added:

legend {
  float: left; // 1
  // Omitted piece of code...
}

It was added, because when we want to have a border on the fieldset element, it will be rendered not properly. Links with the example in the following comment:
#30345 (comment).

So let's recap. The main reason why all of this was added is the presence of a border on the fieldset element. But, the correct rendering of the border could be achieved with the outline property, instead of the border property.
Example link: https://stackblitz.com/edit/js-dydeas?file=index.html.

fieldset {
    border: none;
    outline: 3px solid #dee2e6;
  }

This approach works well for rendering a border around a fieldset element and also does not have the problem with the leading element next to the legend.

I've already created a pull request for it: #39498.
Since the method proposed above solves the problem of an incorrectly rendered border, I believe that we can safely remove unnecessary lines (which I suggested removing in my pull request). Because the problem described by @rajapandiyan-settu really greatly affects the performance.
Please review this issue and let me know if this proposal is suitable?

Related issues

P.S. @rajapandiyan-settu
Specific to your situation, you can download already minified bootstrap.min.css file into your project, so that you will use it not from CDN, but directly from your project, and delete unneccessary lines of code specified above.

P.S.2. @julien-deramond I've noticed that you reacted with the 👀 emoji, so maybe this investigation will be helpful for you.

from bootstrap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.