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

Shortcuts for prop and scope? #1

Open
SebastianVomMeer opened this issue Sep 1, 2015 · 3 comments
Open

Shortcuts for prop and scope? #1

SebastianVomMeer opened this issue Sep 1, 2015 · 3 comments

Comments

@SebastianVomMeer
Copy link

Do you plan to add shortcuts for pakyow-data-attributes like you did for pakyow-slim? HAML-like

.tweet{ data: { scope: :tweet }  }

seems a little inconvenient.

@bryanp
Copy link
Contributor

bryanp commented Sep 1, 2015

It's something that should be possible but we haven't pursued it yet. What syntax would you like to see?

@SebastianVomMeer
Copy link
Author

I don't know if there is a supported and therefore easy way to extend HAML. Ignoring that something like the SLIM approach seems fine:

.tweet@@tweet
  @name User's name

On the other hand, skipping the data in the hash notation looks more descriptive:

.tweet{ scope: :tweet }
  %div{ prop: :name }

However, hijacking the attribute definition syntax seems odd. HAML also has the object reference syntax, perhaps this could be extended to accept some kind of hash notiation:

.tweet[ scope: :tweet ]
  %div[ prop: :name ]

But as I said, I am not an expert in this domain.

@bryanp
Copy link
Contributor

bryanp commented Sep 1, 2015

Cool, I'd like to research what's possible. Any of the options you posted would work pretty well from a user's perspective. I am not expert on HAML either; used it briefly before moving onto SLIM. If you beat me to it, let me know what you find out!

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

2 participants