You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/09/01 19:11:40 UTC

[GitHub] [superset] rusackas edited a comment on issue #15264: [Proposal][style-guide]Tips and best practices for Emotion `styled`/`css` implementation

rusackas edited a comment on issue #15264:
URL: https://github.com/apache/superset/issues/15264#issuecomment-878402092


   Thoughts on some "rules" to make this more of a style guide. Please feel free to suggest additional ones or contest anything controversial here.
   
   **DO** use `styled` when you want to include additional (nested) class selectors in your styles
   **DO** use `styled` components when you intend to export a styled component for re-use elsewhere 
   **DO** use `css` when you want to amend/merge sets of styles compositionally
   **DO** use `css` when you're making a small, or single-use set of styles for a component
   **DO** move your style definitions for the `css` prop to an external variable when they get long
   **DO** prefer tagged template literals (`css={css...`) over style objects wherever possible for maximum style portability/consistency (note: typescript support may be diminished, but IDE plugins like [this](https://marketplace.visualstudio.com/items?itemName=jpoissonnier.vscode-styled-components) make life easy)
   
   **DO NOT** use `styled` for small, single-use style tweaks that would be easier to read/review if they were inline
   **DO NOT** export incomplete AntD components (make sure all their compound components are exported)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org