Load only the necessary styles and scripts

Created on 27 December 2017, almost 7 years ago
Updated 14 September 2024, 2 months ago

Hello.

Today I found - all CSS is loading on the page from CDNJS. In votingapi_widgets.libraries.yml CSS's described as one library (two in fact).

I already added to my themes/custom/easydrupal/easydrupal.info.yml as temporary solution

libraries-override:
  votingapi_widgets/fontawesome:
    css:
      theme:
        https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css: false
  votingapi_widgets/fivestar:
    css:
      theme:
        https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css: false
        https://cdnjs.cloudflare.com/ajax/libs/jquery-bar-rating/1.2.1/themes/bars-square.min.css: false
        https://cdnjs.cloudflare.com/ajax/libs/jquery-bar-rating/1.2.1/themes/bars-pill.min.css: false
        https://cdnjs.cloudflare.com/ajax/libs/jquery-bar-rating/1.2.1/themes/bars-movie.min.css: false
        https://cdnjs.cloudflare.com/ajax/libs/jquery-bar-rating/1.2.1/themes/bars-horizontal.min.css: false
        https://cdnjs.cloudflare.com/ajax/libs/jquery-bar-rating/1.2.1/themes/fontawesome-stars.min.css: false
        https://cdnjs.cloudflare.com/ajax/libs/jquery-bar-rating/1.2.1/themes/fontawesome-stars-o.min.css: false
        https://cdnjs.cloudflare.com/ajax/libs/jquery-bar-rating/1.2.1/themes/bars-reversed.min.css: false
        https://cdnjs.cloudflare.com/ajax/libs/jquery-bar-rating/1.2.1/themes/bootstrap-stars.min.css: false

However, I am proposing to explode all libraries/CSS to own libraries and attach to the form only few depends on user's settings.
For example, my website already uses "CSS stars"

so I want to viev css-stars.min.css and dependies only.

I will provide a patch soon if find time for this work.

πŸ“Œ Task
Status

Needs review

Version

2.0

Component

Theming

Created by

πŸ‡ΊπŸ‡¦Ukraine Ruslan Piskarov Kiev, Ukraine

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024