Comments (5)
Maybe the <StyleProvider>
introduced in #158 should be responsible for outputting the <link>
tags as well? And maybe it could take a baseURL just in case folks aren't comfortable with linking to unpkg.com
?
from react.
Okay, after hacking on this in #238 so that we can use Next's sass loader, I have some better-formed opinions on how this should be done. Here's a proposed plan:
- Introduce a
<BaseCSS />
component that includes primer-base and whichever other styles we need to support existing components. - As we factor out Primer CSS from components, we remove the imports and npm dependencies. (For instance,
primer-labels
goes away when we - When we're done refactoring components, all that should remain is primer-base.
- Figure out how to implement style encapsulation correctly.
- Once styles are properly encapsulated and
<BaseCSS />
is no longer needed, we make that component rendernull
. - Remove the
<BaseCSS />
component in the next major release.
What do you think, @broccolini @emplums @jonrohan?
from react.
Curious what you were thinking for Figure out how to implement style encapsulation correctly.
? Does "styles are properly encapsulated" === using all CSS in JS or are you thinking about something else?
from react.
@emplums I honestly don't know. Like, should all our components have the default font-family
and line-height
? I don't know how total style encapsulation is really possible without doing that. Or do we add a component that inlines the base styles with <style scoped>
? /cc @broccolini
from react.
Done in #260
from react.
Related Issues (20)
- Sub-component pattern cause error when used in React Server Components HOT 1
- Get ActionBar axe clean
- Type checking is too slow HOT 3
- Clean up custom element styled class names
- Underline nav: Doesn't work well on the smallest breakpoints HOT 11
- Release Tracking
- Setting `required` to `input` element within `TextInput` HOT 2
- TypeError: CSS.supports is not a function when running Jest tests HOT 2
- Active `NavList.Item` is incorrectly missing bold styling HOT 4
- The theme object inflates bundle size. HOT 1
- Release Tracking
- The `useAnchoredPosition` hook returns generic refs for Element, which always requires a type assertion by the user
- TreeView: Remove aria-describedby when leading and trailing visuals do not exist HOT 2
- Does the Primer Design System have card components or similar card-like components? HOT 1
- Release Tracking HOT 1
- TreeView: Add support for external styling HOT 2
- TexInput `onClick` focus behavior broken with `type=date` on Safari
- `Dialog` should allow wrapping content, header, and footer (for example in `Suspense` or some context) HOT 1
- Utils should be exported
- Tests: Remove redundant ThemeProvider from tests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react.