ampproject / ampproject/amphtml

Adding class from amp-access

Open
#34,164 1 comment 1 reaction 0 assignees View on GitHub
P3: When Possible Stale Type: Feature Request WG: monetization
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

I have a case when I need to add a class if amp-access is true.

```



{content}


{limitedContent}



```

As I understand, now we can just hide our elements.

I think it would be cool if we could add css class based on amp-access condition

For Example:

```



{content}





```

Contributor guide

Open the contributing guide

Research direction

Start by tracing the existing amp-access behavior described in the issue and how its conditions are evaluated. Determine where an amp-access-class attribute could be handled, then verify that the requested condition adds the appropriate class for both true and false outcomes and does not rely on hiding the elements.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.