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

🏗 Collect z-index from JS files #32847

Merged
merged 17 commits into from
Mar 4, 2021

Conversation

alanorozco
Copy link
Member

@alanorozco alanorozco commented Feb 24, 2021

z-index can be set on JS files:

setStyle(element, 'z-index', 1);
setStyles(element, {'z-index': 1});

<div style={{zIndex: 30}} />

export const JSS = {
  className: {
    zIndex: 'auto',
  },
};

This allows gulp get-zindex to collect these instances.

List is also now formatted with link.

* @param {string=} cwd
* @return {Object}
*/
async function getZindexChainsInJs(glob, cwd = '.') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would this still work for references or does the value have to be on the call site? (apologies, still trying to read through the code)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will not follow references.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have any lint rules to enforce it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. I haven't encountered it so far.

@alanorozco alanorozco merged commit 5a46442 into ampproject:master Mar 4, 2021
@alanorozco alanorozco deleted the get-zindex-js branch March 4, 2021 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants