Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

feat(style): adding typographic variables to theme #463

Conversation

rusackas
Copy link
Member

@rusackas rusackas commented May 8, 2020

💔 Breaking Changes

🏆 Enhancements
Adding a few styles to the superset theme object, just to fiddle around with in other packages

📜 Documentation

🐛 Bug Fix

🏠 Internal

@vercel
Copy link

vercel bot commented May 8, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/superset/superset-ui/3yug0msbh
✅ Preview: https://superset-ui-git-fork-preset-io-adding-basic-typograph-97720b.superset.now.sh

@rusackas rusackas changed the title adding typographic variables to theme feat: adding typographic variables to theme May 8, 2020
@codecov
Copy link

codecov bot commented May 8, 2020

Codecov Report

Merging #463 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #463   +/-   ##
=======================================
  Coverage   22.36%   22.36%           
=======================================
  Files         266      266           
  Lines        6549     6549           
  Branches      605      605           
=======================================
  Hits         1465     1465           
  Misses       5047     5047           
  Partials       37       37           
Impacted Files Coverage Δ
packages/superset-ui-style/src/index.ts 100.00% <ø> (ø)
plugins/preset-chart-xy/src/BoxPlot/index.ts 0.00% <0.00%> (ø)
...lugins/preset-chart-xy/src/BoxPlot/legacy/index.ts 0.00% <0.00%> (ø)

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 69a004c...21d2c7e. Read the comment docs.

xl: '21px',
xxl: '28px',
},
},
gridUnit: '4px',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make these numeric so possible future computation can be easier? I think it makes sense to make base units always be pixels.

Copy link
Contributor

@ktmud ktmud May 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've gone back and forth on this, and so have others in the discussions. The numeric bits do make things simpler in one sense, but being explicit about units in the theme also opens you up to having heterogeneous units, e.g. some things in rems or viewport units, or percentages, or whatever, without having to interpret them when looking at the theme file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But yes, I'll make the change... this is really just to support a little POC work... we can adjust as this thing grows.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the other downside is that we'd have to tack on the px in exponentially more places in the code (every instance of the style bing used), where it's centralized here. But we can try it out this way and see how it goes.

@ktmud Change is committed, if you don't mind approving, so I can work on the new POC PR.

Copy link
Contributor

@ktmud ktmud May 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m in favor of using relative units whenever possible, but baseUnits should be pixels as the computation needs to start from somewhere. Which are categorized as baseUnits is debatable, but I’d imagine most of those in the core theme definition should be.

Another choice is to use CSS variables. Facebook just did that in their new website: https://engineering.fb.com/web/facebook-redesign/

@kristw kristw changed the title feat: adding typographic variables to theme feat(style): adding typographic variables to theme May 8, 2020
@rusackas rusackas merged commit f06cb4a into apache-superset:master May 11, 2020
@rusackas rusackas deleted the adding-basic-typography-settings-to-theme branch May 11, 2020 18:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants