0

In an existing project, the CSS files are compiled with less. In web/css/ I have three files: all.less, main.less and styles.less:

web/css/all.less:

@import '../vendor/bootstrap-2.3.2/less/bootstrap.less';
@import 'styles.less';
@import 'main.less';

In styles.less file I've added the next line:

.btn {
    font-size: 13px !important;
}

This class (.btn), has not more !important tags.

Then I compile the all.less file with command line:

lessc web/css/all.less

and the compiled file (web/compiled/b2b7f11.css) has the added lines (.btn {...).

This CSS file is called from a template:

    {% stylesheets output='compiled/css/*.css' 'css/all.less' %}
        <link rel="stylesheet" href="{{ asset_url }}" />
    {% endstylesheets %}

but when I reload the browser (after clearing browser cache), the changes (font-size) are not loaded. The font-size rule still keep the older value (14px). Any idea of what I'm missing?

I'm working on a development environment, so I don't need to clear cache.

9
  • Try cleaning the cache in your browser. Or check if the url is corrected in the html (with a inspector like chrome), and the errors in the references (in the chrome console), maybe could be 2 problems, first one, the cache, second one, error in the render of the paths Commented Feb 26, 2014 at 14:25
  • @user3294396 - I had cleared the browser cache. The file loaded is web/compiled/css/b2b7f11_all_1.css. Commented Feb 26, 2014 at 14:27
  • 1
    don't use important unless absolutely necessary. And if you use Google chrome you need to clear cache. There is an option to disable cache when the developer tools is open. Also is there a parent around that class in your css? maybe you added the css in the wrong place Commented Feb 26, 2014 at 14:29
  • Check the tag with .btn with the chrome inspector. That shows you the css that the reference is obtained. You can check that. Commented Feb 26, 2014 at 14:30
  • @user3294396 - As I've said, the new lines are not loaded. It has a font-size:13px from other line. Commented Feb 26, 2014 at 14:31

2 Answers 2

1

I was clearing the cache for production mode. Solved with the next command:

php app/console cache:clear --env=dev --no-debug
Sign up to request clarification or add additional context in comments.

Comments

0

Quick search led me to this Symfony2, loading css files without cache

Give a shot at the selected answer and tell me if it worked or not, this seems to be close enough to your issue.

-Karink.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.