Skip to content

Overwriting mixin properties  #1873

Description

@Pupix

Hello! I am trying to overwrite a property coming from a CSS mixing, but the way Polymer handles the variables makes it impossible to do so (without using "!important").

<style>
    .foo {
        @apply(--paper-font-caption)
        white-space: normal;
    }
</style>

The expected result would be to have "white-space: normal" applied on top of the one provided by paper-styles, however that's not the case.

Do I have to rewrite the entire mixing just to change one property or is there an alternative way?

Cheers.

Activity

  1. self-assigned this
    on Jun 16, 2015
  2. sorvell commented on Jun 16, 2015

    @sorvell
    Contributor

    This is due to the way that Polymer separates static styles from styles which contain custom properties. This use case is reasonable and our approach needs to be modified slightly to support this better.

    We will probably not separate custom properties css from static css within rules that contain properties.

  3. Pupix commented on Jun 16, 2015

    @Pupix
    Author

    Thanks for the response. Will wait for an update then.

  4. sorvell commented on Aug 21, 2015

    @sorvell
    Contributor

    This issue also leads to specificity issues when combining static and custom property rules.

  5. robrez commented on Oct 28, 2015

    @robrez

    👍

  6. jmcgdz commented on Oct 28, 2015

    @jmcgdz

    👍

  7. nazar-pc commented on Oct 29, 2015

    @nazar-pc
    Contributor

    @Pupix, can you provide complete test case? I guess this might be either already fixed by #2642 or I can try to extend PR to cover this case as well and add corresponding test case.

  8. robrez commented on Oct 29, 2015

    @robrez

    @nazar-pc Here's a jsbin that, i think, demonstrates the issue:

    https://jsbin.com/kefuzi/edit?html,output

  9. nazar-pc commented on Oct 29, 2015

    @nazar-pc
    Contributor

    OK, here is easier to understand example: https://jsbin.com/xupufudivu/1/edit

  10. nazar-pc commented on Oct 29, 2015

    @nazar-pc
    Contributor

    Seems to be different area than covered in #2642, but I'll take a look on this as well.

  11. added a commit that references this issue on Oct 29, 2015
    092a9d0
  12. nazar-pc commented on Oct 29, 2015

    @nazar-pc
    Contributor

    #2642 now fixes this issue as well.

  13. added a commit that references this issue on Nov 4, 2015
    3ea889e
  14. added a commit that references this issue on Nov 13, 2015
    fd57784
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions