Dynamic on the fly CSS generation
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- bootstrap, rails, ruby, scss
- Domain
- build-system, tooling
Research direction
Start with the controller action and app/assets/stylesheets/foobar_bootstrap.scss shown in the report, then inspect SassC::Engine import and load-path configuration. Verify how the static asset resolves bootstrap, determine whether the same resolution can work for generated CSS, and clarify whether selective color-only output is in scope; no tests are mentioned.
Written by the indexing model from the issue text.
Description
Hi,
I installed the following gems (in a rails 5.2.8.1 project on ruby 2.7.7)
gem 'sass-rails', '~> 5.0'
gem 'bootstrap', '~> 5.3.1'
gem 'sassc', '~> 2.4.0'
If I create a file like app/assets/stylesheets/foobar_bootstrap.scss
with content
$primary-color: blue;
@import "bootstrap";
it works perfect, however if I wish to generate styles on the fly in a controller action like
sass_code = "$primary-color: blue; @import \"bootstrap\";"
css_output = SassC::Engine.new(sass_code, syntax: :scss).render
render plain: css_output, content_type: 'text/css'
I'm getting the error File to import not found or unreadable: bootstrap
any idea on how to point sassc to the right file?
Also I only want to overwrite the main colors, is there a lightweight way to only output all classes related to colours but leave the bulk file statically served?
- Dominant language
- SCSS
- Stars
- 2k
- Forks
- 437
- Avg merge
- 1h
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from twbs/bootstrap-rubygem
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
twbs/bootstrap-rubygem#294 · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
twbs/bootstrap-rubygem#291 · 2 comments · 7 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 38/100
twbs/bootstrap-rubygem#289 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
twbs/bootstrap-rubygem#288 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
twbs/bootstrap-rubygem#284 ·
All issues in twbs/bootstrap-rubygem
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
self-care self-care:docs-build-time-investigator
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
githubnext/gh-aw-cao#15846 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 95/100
Qiskit/qiskit-cpp#167 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Qiskit/benchpress#116 · 1 comment ·