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

Force-attribute for 2+ attributes for HTML in .liquidrc #89

Closed
james0r opened this issue May 4, 2022 · 3 comments
Closed

Force-attribute for 2+ attributes for HTML in .liquidrc #89

james0r opened this issue May 4, 2022 · 3 comments
Labels
🎀 Æsthetic The issue pertains to Æsthetic

Comments

@james0r
Copy link
Contributor

james0r commented May 4, 2022

Seems like many conventions drop attributes to a new line for 2 or 3+ attributes.

Would be nice to see either only multiple attribute tags dropped to new lines, or have a prop in .liquidrc for force-attribute-threshhold or something, after which attributes are forced to new line.

Thanks!

@panoply
Copy link
Owner

panoply commented May 4, 2022

Use wrap at 85, eg:

 "html": {
    "correct": true,
    "force_attribute": false,
    "braces": false,
    "preserve": 1,
    "wrap": 85,
    "preserve_text": true,
    "content": true,
    "space_close": true,
    "tags": [
      {
        "tag": "source",
        "rules": {
          "force_attribute": true,
          "space_close": true
        }
      }
    ]
  },

@panoply
Copy link
Owner

panoply commented May 4, 2022

FYI: If you have Liquid tags you can do this:

  <nav
    class="accordion mt-3 mb-2"
    data-accordion-collapsible-value=" {{- some_tag }}" // notice the space between quotation and " {{-
    data-accordion-multiselect-value=" {{- some_tag }}"  // notice the space between quotation and " {{-
    data-controller="accordion">
  </nav>

It will help prevent the tags from breaking.

panoply added a commit to panoply/esthetic that referenced this issue Jul 6, 2022
@panoply panoply added 🎀 Æsthetic The issue pertains to Æsthetic v3.0.0 labels Sep 25, 2022
@panoply
Copy link
Owner

panoply commented Sep 28, 2022

🚢 Shipped v3.0.0

@panoply panoply closed this as completed Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎀 Æsthetic The issue pertains to Æsthetic
Projects
None yet
Development

No branches or pull requests

2 participants