Skip to content

Composition is only allowed when selector is single :local class name #261

Closed
@0x80

Description

@0x80

I'm working on a project using Leaflet and overruling their standard tooltip layout doing something like this:

:global {
  /*
    The custom-tooltip class is set on the map container to address and overrule the tooltip classes by using a higher selector specifity.
  */
  .custom-tooltip .leaflet-tooltip-left,
  .custom-tooltip .leaflet-tooltip-right,
  .custom-tooltip .leaflet-tooltip-top {
     composes: shadowBottomFilter from '../../shared-styles/base-classes';
}

This gives me an error:

Error: composition is only allowed when selector is single :local class name not in ".leaflet-tooltip-left,
  .leaflet-tooltip-right,
  .leaflet-tooltip-top", ".leaflet-tooltip-left" is weird

I'm not sure why this would not be allowed or is considered weird. What would be the correct approach you think?

Activity

TrySound

TrySound commented on Aug 28, 2017

@TrySound
Member

Composition works differently to mixins. It does not mutates rules, just concatenates names.
#251
#202

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @0x80@TrySound

        Issue actions

          Composition is only allowed when selector is single :local class name · Issue #261 · css-modules/css-modules