question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inline plugin global styles

See original GitHub issue

So since the current approach to declaring global styles seems to be best accomplished through preflight, it would be nice to provide some kind of merging strategy for common selector keys as to avoid this sort of code…

preflight: ({ html, ...preflight }, { theme }) => ({
  ...preflight,
  html: {
    color: theme('colors.gray.900'),
    ...html,
  },
})

Otherwise, I think there should be some discussion about ways to declare global styles.

Regarding this new (:global)[https://github.com/tw-in-js/twind/blob/main/docs/plugins.md#inject-global-styles] property, is it at all possible to declare global styles from within inline plugins? That would be a nifty way to allow declaration of global styles from virtually anywhere in your app.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
tylerforesthausercommented, Jan 17, 2021

Done

0reactions
sastancommented, Jan 17, 2021

@tylerforesthauser This issue has two topics. Using tw.apply in :global and in preflight should now be fixed in #83 . Preflight merging should be a new issue discussing its impact. Could you please create one only for merging preflight styles.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove global-styles-inline-css - WordPress.org
I've just updated a site which doesn't use Gutenberg to 5.9 and a huge block of styling has appeared at the top of...
Read more >
How to remove global inline styles in WordPress - Perfmatters
It's always recommended to click around your site after enabling it to confirm everything looks good visually. Step 1. Click into the Perfmatters...
Read more >
How to Disable Global Styles Inline CSS in WordPress
... for beginners you will learn how to disable global inline styles css in wordpress by adding code in functions.php or plugin in...
Read more >
How to display inline, floating, and follow buttons ... - Novashare
Follow the steps below to enable global styles. Step 1. Click into the Novashare plugin settings. Novashare plugin ...
Read more >
Global Styles & theme.json - Full Site Editing
Global Styles help users change the style of their site without having to edit individual blocks or pages. It also lowers the entry...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found