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

Parse inline styles #34

Merged
merged 5 commits into from
Oct 10, 2022
Merged

Parse inline styles #34

merged 5 commits into from
Oct 10, 2022

Conversation

sanajaved7
Copy link
Contributor

Description

  • Updated our fetch logic to call a new function: fetchInlineStyles
  • This looks for any element with a style attribute that includes the word 'anchor'
  • For the selector, it uses either the element's ID but if there is not an ID, then the class list
  • Then it formats the styles with the selector to resemble CSS from style tags so that we can pass it to the parsing function and use it the same way

Steps to test/reproduce

  • In the demo, there is now an example for anchor positioning with inline styles. When the polyfill is applied, it should also correctly anchor the floating and anchor elements with inline styles.

@netlify
Copy link

netlify bot commented Sep 27, 2022

Deploy Preview for anchor-polyfill ready!

Name Link
🔨 Latest commit 8a312b6
🔍 Latest deploy log https://app.netlify.com/sites/anchor-polyfill/deploys/63445578026a1400097da526
😎 Deploy Preview https://deploy-preview-34--anchor-polyfill.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@sanajaved7
Copy link
Contributor Author

* main:
  Add (skipped) tests for upcoming features
  Fix upgrade script
  lint
  no --immutable-cache
  Try without yarn cache?
  NPM -> Yarn
  chore(deps): Automated dependency upgrades
  cleanup types
  refactor to remove unneeded ifs and elses
  fix failing test
  check isInset on properties
  review
  initial commit
Copy link
Member

@jgerigmeyer jgerigmeyer left a comment

Choose a reason for hiding this comment

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

@sanajaved7 This works great! Just one minor suggestion for dealing with selectors.

src/fetch.ts Outdated Show resolved Hide resolved
jgerigmeyer and others added 2 commits October 10, 2022 10:44
* main:
  chore(deps): Automated dependency upgrades
  address review
  Use standard (serve/lint) commands
Copy link
Member

@jgerigmeyer jgerigmeyer left a comment

Choose a reason for hiding this comment

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

👏

@jgerigmeyer jgerigmeyer merged commit 63886fd into main Oct 10, 2022
@jgerigmeyer jgerigmeyer deleted the parse-inline-styles branch October 10, 2022 17:44
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

Successfully merging this pull request may close these issues.

2 participants