Skip to content

Prefix class names with filter-? #159

Open

Description

@tomByrer

Advantages:

  • prevents an onboarding devs say "What the ___ is 'hudson'?"
  • allows global search/replace/delete

Disadvantages:

  • larger files (mostly negated by gzip)
  • more typing (reduced by editors' autocomplete, copy/paste|search/replace
  • add extra coding to gulpfile

Could prefix with cssgram- also, less clear, but helps in finding this repo.

Activity

  1. henryruhs commented on Mar 12, 2016

    @henryruhs

    1+

  2. una commented on Mar 21, 2016

    @una
    Owner

    Hey @tomByrer -- I agree with namespacing being a good idea for semantic understanding. My biggest concern with this is that it would be a breaking change to the previous workflow and would affect everyone who has already implemented the library. The question here is -- is that tradeoff worth it?

  3. Effeilo commented on Mar 27, 2016

    @Effeilo

    1+
    Another advantage, it will ease the code. for example

    [class*="cssgram-"] {
      position: relative;
    }
    
    [class*="cssgram-"]:before, 
    [class*="cssgram-"]:after {
      content: '';
      display: block;
      height: 100%;
      width: 100%;
      top: 0;
      left: 0;
      position: absolute;
      pointer-events: none;
    }
    
    [class*="cssgram-"] > img {
      width: 100%;
      z-index: 1;
    }
    
    [class*="cssgram-"]:before {
      z-index: 2;
    }
    
    [class*="cssgram-"]:after {
      z-index: 3;
    }
  4. tomByrer commented on Mar 28, 2016

    @tomByrer
    ContributorAuthor

    @una Could keep the old class names, & make *.prefix.css|scss` files.
    @Effeilo good ideas

  5. una commented on Apr 12, 2016

    @una
    Owner

    @Effeilo I really like what you did there -- it would reduce redundant code. This is definitely swaying me toward the prefixed version

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

      Issue actions