openedx / edx-platform

The Open edX LMS & Studio, powering education sites around the world!
https://openedx.org
GNU Affero General Public License v3.0
7.32k stars 3.84k forks source link

Replace builtin block Sass with vanilla CSS #35300

Open kdmccormick opened 1 month ago

kdmccormick commented 1 month ago

Background

Follows up from:

The goal of this task is to entirely convert the Sass in the ./xmodule/ directory into vanilla CSS which can be loaded with the standard ResourceLoader class from xblock.utils. The immediate benefit is that we can remove the xmodule Sass build steps from edx-platform. The longer-term benefit is that this will remove any Sass build concerns from the xblock extraction effort.

Tasks

  1. Ensure Sass has been compiled into uncompressed CSS (npm run compile-sass-dev).
  2. Copy all the built-in compiled XBlock CSS (lms/static/css/*Display.css and lms/static/css/*Editor.css) into xmodule/assets. Add those CSS files to version control.
  3. For each XBlock with Sass: Replace its add_sass_to_fragment call with standard usage of a xblock.utils.resources.ResourceLoader and fragment.add_css.
  4. Remove the definition of add_sass_to_fragment from xmodule.util.builtin_assets.py
  5. Remove all .scss files under xmodule/assets
  6. Remove all compile_sass_dir(...) calls in scripts/compile_sass.sh which compile Sass under xmodule/assets.
  7. Update xmodule/assets/README.rst
farhan commented 4 weeks ago

Perhaps duplicate of https://github.com/openedx/edx-platform/issues/35306

kdmccormick commented 4 weeks ago

@farhan Whereas #35306 concerned converting just the variables, this issue will concern converting the entire files from .scss to .css

kdmccormick commented 3 weeks ago

@farhan I've filled this one in. Let me know if you have any questions.