Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classnames #14

Closed
kof opened this issue May 25, 2017 · 3 comments
Closed

Classnames #14

kof opened this issue May 25, 2017 · 3 comments

Comments

@kof
Copy link
Member

kof commented May 25, 2017

As we def. need to support both scoped (generated) and regular class names, there is a question how to do that in a way that doesn't introduces much troubles to the runtimes.

I think class name generation algorithm should be out of scope for the standard, instead runtime should decide. There are too many hashing algorithms and counter based solutions. If we would try to generate the class name within the standard, we would need to make sure it will work across the entire world. If we let runtimes decide on the algorithm, it just has to work within a specific project.

@kof
Copy link
Member Author

kof commented May 25, 2017

One idea I have to solve this is a class name template: .my-button-{id}, where {id} can be replaced by the runtime. If a class name has no id, it automatically makes it "global".

@kof
Copy link
Member Author

kof commented May 25, 2017

Another idea which is based on #13

[
  [ SELECTOR_OPEN ],
  [ SELECTOR, '.foo', SCOPED ],
  [ PROPERTY, 'prop' ],
  [ VALUE, 'value' ],
  [ SELECTOR_OPEN ],
  [ SELECTOR, '&:psuedo' ],
  [ PROPERTY, 'foo' ],
  [ VALUE, 'bar' ],
  [ SELECTOR_CLOSE ],
  [ SELECTOR_CLOSE ],
]
.foo-123456 {
  prop: value;
  &:pseudo {
    foo: bar;
  }
}

Instead of [ SELECTOR, '.foo', SCOPED ], it could be also [ SCOPED_SELECTOR, '.foo'],

@kof
Copy link
Member Author

kof commented Jun 16, 2017

I think we got this in #17

@kof kof closed this as completed Jun 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant