Custom StyleSheet
See original GitHub issueHi! I found emotion in creating a new Sheet based on the old sheet. Is it possible to get rid of this behavior, or use the same constructor as the cache.sheet
has?
I’m handling a very special environment and I must implement my own StyleSheet
class to insert rules. It’s be like this:
const emotionCache = createEmotionCache({ key: keyA })
const styleSheet = new MySpecialStyleSheet(keyA, shadow)
emotionCache.sheet = styleSheet
It works well besides the global styles. Global styles using the emotion’s original implementation therefore I cannot control the insertRule behavior.
If I can provide my own StyleSheet implementation, or at least emotion can write this to use my StyleSheet:
let sheet = new cache.sheet.constructor({
...
})
it will be great! thanks!
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (15 by maintainers)
Top Results From Across the Web
Adding a Custom Stylesheet | Gantry Documentation
This tutorial will take you through the steps needed to add a custom stylesheet to your Gantry template, without worrying about lost changes...
Read more >Create, edit, and attach CSS files to style your site
On theTemplates tab, scroll to CSS & Stylesheets. To add a stylesheet, click + Add style sheet. Click the X beside an attached...
Read more >Custom stylesheet - Harvard's Digital Accessibility Services
Use responsive design to allow your content to zoom and respond to various screen sizes. Present content without loss of information or functionality,...
Read more >About Custom Style Sheets - Oracle
A custom style sheet extends the styles defined in the style sheet for a parent look and feel. In ADF UIX, a custom...
Read more >Apply a Custom Stylesheet - Asciidoctor Docs
Specify the custom stylesheet. Asciidoctor looks for the stylesheet file specified by the stylesheet document attribute. If the value of this attribute is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Would you be open to preparing a PR for the
cache.sheet.constructor
change?Hi there,
nice to see you here - thank you for your great OSS work! I can’t wait for throw types to happen 😉
Using
cache.sheet.constructor
withinGlobal
seems like something that we could do. Considering it’s a simple change and that it wouldn’t break anything and doesn’t really introduce any new options/configuration etc this is a solution that I would prefer. Especially that you could only tweak your cache once and the rest of the thing would “just work”.If you prepare a PR for such a change with tests then I would happily merge it.
Out of my curiosity - could you describe this in more detail? I love learning about quirky use cases 😛