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

fix(styles): Fix for importing and handling project-stylesheet if only tokens are used. #530

Merged
merged 4 commits into from Jan 11, 2021

Conversation

JayaKrishnaNamburu
Copy link
Member

@JayaKrishnaNamburu JayaKrishnaNamburu commented Jan 8, 2021

Currently tokens and Project StyleSheet are tightly coupled. Like tokens for css and css-modules are basically css-variables. Which works only when imported. But if a project is not using project-style-sheet at all. Then the tokens are not imported. So, need some extra checks and ways. So, if the project-style-sheet is not used. Then tokens are imported directly in the router of the project. Which is a entry point.

fixes #529

TODO

  • Gatsby + CSS-Modules still needs a solution

@JayaKrishnaNamburu JayaKrishnaNamburu added the style flavours All issues and pull requests that are relates to styles. (Adding a style plugins, making a change) label Jan 8, 2021
@JayaKrishnaNamburu JayaKrishnaNamburu self-assigned this Jan 8, 2021
@codecov
Copy link

codecov bot commented Jan 9, 2021

Codecov Report

Merging #530 (115adf6) into development (8a23bcc) will decrease coverage by 0.37%.
The diff coverage is 71.67%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development     #530      +/-   ##
===============================================
- Coverage        76.27%   75.90%   -0.38%     
===============================================
  Files              156      156              
  Lines             5698     5710      +12     
  Branches          1208     1227      +19     
===============================================
- Hits              4346     4334      -12     
- Misses            1291     1309      +18     
- Partials            61       67       +6     
Impacted Files Coverage Δ
...ort-component-generator/src/assembly-line/index.ts 90.90% <0.00%> (-4.33%) ⬇️
...kages/teleport-project-generator-next/src/utils.ts 86.53% <ø> (-0.26%) ⬇️
packages/teleport-project-generator/src/utils.ts 81.30% <ø> (ø)
packages/teleport-plugin-react-jss/src/utils.ts 47.05% <20.00%> (-8.50%) ⬇️
...leport-plugin-react-styled-components/src/utils.ts 76.78% <20.00%> (-2.17%) ⬇️
...es/teleport-project-generator/src/file-handlers.ts 75.75% <40.00%> (-2.45%) ⬇️
packages/teleport-project-generator/src/index.ts 61.98% <40.00%> (-1.71%) ⬇️
packages/teleport-plugin-css/src/index.ts 83.33% <60.00%> (-1.29%) ⬇️
packages/teleport-plugin-css-modules/src/index.ts 90.29% <64.28%> (-3.65%) ⬇️
...-plugin-react-styled-components/src/style-sheet.ts 90.00% <70.00%> (-2.69%) ⬇️
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a23bcc...115adf6. Read the comment docs.

@JayaKrishnaNamburu JayaKrishnaNamburu changed the title fix(styles): importing project-stylesheet if only tokens are used fix(styles): Fix for importing and handling project-stylesheet if only tokens are used. We don't need to import style-sheet in every single component when there no re-usable styles Jan 10, 2021
@JayaKrishnaNamburu JayaKrishnaNamburu changed the title fix(styles): Fix for importing and handling project-stylesheet if only tokens are used. We don't need to import style-sheet in every single component when there no re-usable styles fix(styles): Fix for importing and handling project-stylesheet if only tokens are used. Jan 10, 2021
@JayaKrishnaNamburu JayaKrishnaNamburu marked this pull request as ready for review January 10, 2021 13:40
Utwo
Utwo previously approved these changes Jan 11, 2021
@Utwo
Copy link
Contributor

Utwo commented Jan 11, 2021

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
style flavours All issues and pull requests that are relates to styles. (Adding a style plugins, making a change)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Project Style sheet is not being added to the root of project
2 participants