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
Handlebars inside class tag removed even with raw tag #797
Comments
Hi, if this is when building for production with https://maizzle.com/docs/transformers/remove-unused-css#backend Right now we're not adding those heads/tails by default, but we probably should... I'll look into it today. EDIT: fixed in #801 |
Dug further and realized the default These and many other fixes will be available in the next release (4.2.3), we just need to wait for a dependency to release a fix these days and we'll publish the new version right away. |
For now, I've done: |
OK, but keep in mind that escaped class names like |
@cossssmin I'm also running into this issue where it's trying to change the disabled attribute in my button to have an
<button class="
day
col-start-{{day_start}}
{{^available_times}}disabled{{/available_times}}
{{#today}}today-dot{{/today}}"
aria-label="{{month}} {{dd}}"
autocomplete="off"
{{^available_times}}
disabled="disabled"
{{/available_times}}
></button> I'm guessing this is from some post processing, but not sure where or how to configure? |
In PostHTML, the parser Maizzle uses, you cannot add attributes in that way to a tag. Each string is considered an attribute and that's why you're seeing the My suggestion is to use a placeholder and Note this had to be fixed and only works in In your template: <button data-available-times></button> In module.exports = {
replaceStrings: {
'data-available-times': `class="
day
col-start-{{day_start}}
{{^available_times}}disabled{{/available_times}}
{{#today}}today-dot{{/today}}"
aria-label="{{month}} {{dd}}"
autocomplete="off"
{{^available_times}}disabled="disabled"{{/available_times}}`
}
} |
By the way, the original issue should also be fixed in <div class="@{{ name }}"></div> ... and have it compile to this: <div class="{{ name }}"></div> |
I upgraded to The .day:not(.disabled) {
@apply bg-blue-700/10 text-blue-700 hover:bg-blue-700/5 active:bg-blue-700/20 cursor-pointer font-semibold;
@apply focus:bg-blue-700 focus:text-white focus:cursor-initial
} Here's how I'm using it which was working in 4.2.2 with <raw>
<amp-list layout="container" src="json/calendar.json">
<template type="amp-mustache">
<div class="date-grid">
{{#date_items}}
{{#available_times}}
<button class="
day
col-start-{{day_start}}" aria-label="{{month}} {{dd}} - Times available">
{{/available_times}}
{{^available_times}}
<button class="
day
col-start-{{day_start}}
disabled" aria-label="{{month}} {{dd}} - No times available" disabled>
{{/available_times}}
{{dd}}
<span class="{{#today}}today-dot{{/today}}"></span>
</button>
{{/date_items}}
{{^date_items}}
<div>No calendar found.</div>
{{/date_items}}
</div>
</template>
<div placeholder>Loading ...</div>
<div fallback>Failed to load data.</div>
</amp-list>
</raw> |
I'm seeing The module.exports = {
removeUnusedCSS: {
whitelist: ['*day*']
}
} However there is an unexpected behavior with |
@tettoffensive have you tried v4.3.0 with whitelisting that selector as above? |
For some reason the handlebars inside the class tag get removed. I've tried both
<raw>
and using the@{}
syntax.<div class="{{name}}" id="{{name}}">
becomes<div class="name" id="{{name}}">
The text was updated successfully, but these errors were encountered: