Material-ui: add fluidTypography and fluidProperty to new css package

Created on 8 Apr 2019  路  12Comments  路  Source: mui-org/material-ui

This is a tracker for the feature request suggested here by @oliviertassinari :

Rather than try to do in the same MR, making a reminder ticket to work on this next.

  • [x] This is not a v0.x issue.
  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior 馃

Please see links above

Current Behavior 馃槸

Examples 馃寛

Context 馃敠

enhancement

Most helpful comment

Thanks, I'll check the contribution guide and see what I can do 馃憤

All 12 comments

fluidProperty() would be super useful to us. Is it still in the works?

@sdornan Nobody is working on it, but we would definitely love a pull request.

By the way, the data-vis in https://material-ui.com/customization/typography/#responsive-font-sizes is wrong, it should be:
Capture d鈥檈虂cran 2019-06-01 a虁 19 08 57

diff --git a/docs/src/pages/customization/typography/ResponsiveFontSizesChart.js b/docs/src/pages/customization/typography/ResponsiveFontSizesChart.js
index feb2da622..373deff22 100644
--- a/docs/src/pages/customization/typography/ResponsiveFontSizesChart.js
+++ b/docs/src/pages/customization/typography/ResponsiveFontSizesChart.js
@@ -45,6 +45,10 @@ export default function ResponsiveFontSizes() {
       const value = theme.breakpoints.up(key);

       if (variant[value]) {
+        data.push({
+          viewport: viewport -1,
+          fontSize: data[data.length - 1].fontSize,
+        });
         data.push({
           viewport,
           fontSize: toPx(variant[value].fontSize),
@@ -74,12 +78,12 @@ export default function ResponsiveFontSizes() {
             left: 30,
           }}
         >
-          <XAxis dataKey="viewport" type="category" allowDuplicatedCategory={false}>
+          <XAxis dataKey="viewport" type="number">
             <Label position="right" offset={30}>
               viewport (px)
             </Label>
           </XAxis>
-          <YAxis dataKey="fontSize">
+          <YAxis dataKey="fontSize" type="number">
             <Label position="top" offset={20}>
               font-size (px)
             </Label>

What's the expected timeline of this feature?

@mahesh-kedari Do you wish to give it a spin with a pull request?

Hello @oliviertassinari, does this feature would make possible to use MUI with a Fluid approach as a whole? With typography elements and other spacing units following this principle? I'm asking because this feature would be very useful at the company I'm working and if that's the case I'm willing to open a PR.

@tonypine The idea of fluidTypography is to implement:

Capture d鈥檈虂cran 2020-05-12 a虁 00 12 12

where responsiveFontSizes implements:

Capture d鈥檈虂cran 2020-05-12 a虁 00 10 08

Yeah, there will still be breakpoints, but the font sizes will transition as if they are scaling down or up with the viewport width, right? Do the fluipProperty would make this possible also for spacings?

I would like to achieve a result similar to this:

2020-05-11 19 23 10

Yeah, there will still be breakpoints

@tonypine breakpoint(s), I imagine we could consider a single one by default for simplicity, like https://github.com/twbs/rfs/tree/v8.0.4#visualisation.

Do the fluipProperty would make this possible also for spacings?

The typography is a concern on its own. Spacing has never been included in the discussion. What's your use case?

@oliviertassinari got it. Scaling in a linear proportion can be achieved with just one breakpoint.

Thanks, I'll check the contribution guide and see what I can do 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Bessonov picture Bessonov  路  93Comments

sjstebbins picture sjstebbins  路  71Comments

garygrubb picture garygrubb  路  57Comments

damianobarbati picture damianobarbati  路  55Comments

tdkn picture tdkn  路  57Comments