Skip to content

Commit

Permalink
dont publish @material-ui/css-utils for now
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed May 1, 2019
1 parent 4419b91 commit 85d4b3c
Show file tree
Hide file tree
Showing 25 changed files with 290 additions and 832 deletions.
10 changes: 0 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ commands:
sudo apt-get update
sudo apt-get install -y --force-yes gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
jobs:
checkout:
<<: *defaults
Expand Down Expand Up @@ -158,12 +157,6 @@ jobs:
- run:
name: '`yarn docs:api` changes committed?'
command: git diff --exit-code
- run:
name: Can we generate the css-utils docs?
command: cd packages/material-ui-css-utils && yarn run docs
- run:
name: 'css-utils `yarn run docs` changes committed?'
command: git diff --exit-code packages/material-ui-css-utils
- run:
name: Can we generate the @material-ui/core build?
command: cd packages/material-ui && yarn build
Expand All @@ -179,9 +172,6 @@ jobs:
- run:
name: Can we generate the @material-ui/system build?
command: cd packages/material-ui-system && yarn build
- run:
name: Can we generate the @material-ui/css-utils build?
command: cd packages/material-ui-css-utils && yarn build
- run:
name: Prepare persisting workspace
command: tar cfvz builds.tar.gz packages/*/build
Expand Down
1 change: 0 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const defaultAlias = {
'@material-ui/styles': './packages/material-ui-styles/src',
'@material-ui/system': './packages/material-ui-system/src',
'@material-ui/utils': './packages/material-ui-utils/src',
'@material-ui/css-utils': './packages/material-ui-css-utils/src',
};

const productionPlugins = [
Expand Down
1 change: 0 additions & 1 deletion docs/src/modules/utils/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export function getDependencies(raw, options = {}) {
'@material-ui/styles': 'next',
'@material-ui/system': 'next',
'@material-ui/utils': 'next',
'@material-ui/css-utils': 'next',
'date-fns': 'next',
jss: 'next',
'jss-plugin-template': 'next',
Expand Down
15 changes: 15 additions & 0 deletions docs/src/pages/customization/themes/ResponsiveFontSizes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import { createMuiTheme, responsiveFontSizes } from '@material-ui/core/styles';
import { ThemeProvider } from '@material-ui/styles';
import Typography from '@material-ui/core/Typography';

let theme = createMuiTheme();
theme = responsiveFontSizes(theme);

export default function ResponsiveFontSizes() {
return (
<ThemeProvider theme={theme}>
<Typography variant="h3">Responsive h3</Typography>
</ThemeProvider>
);
}
25 changes: 0 additions & 25 deletions docs/src/pages/customization/themes/ResponsiveFonts.js

This file was deleted.

56 changes: 42 additions & 14 deletions docs/src/pages/customization/themes/themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,15 +345,34 @@ html {

{{"demo": "pages/customization/themes/FontSizeTheme.js"}}

### Responsive fonts
### Responsive font sizes

To define different font sizes for different devices of varying screen widths (with larger font sizes for larger screens), we can use [media queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries) to wrap the `font-size` property.
The typography variants properties map directly to the generated CSS.
You can use [media queries](/layout/breakpoints/#api) inside them:

You can see this in action in the example below. adjust your browser's window size, and notice how the font size changes as the width crosses the `sm` and `lg` [breakpoints](/layout/breakpoints).
```js
const theme = createMuiTheme();

theme.typography.h1 = {
fontSize: '3rem',
'@media (min-width:600px)': {
fontSize: '4.5rem',
},
[theme.breakpoints.up('md')]: {
fontSize: '6rem',
},
};
```

To automate this setup, you can use the [`responsiveFontSizes()`](#responsivefontsizes-theme-options-theme) helper to make Typography font sizes in the theme responsive.

You can see this in action in the example below. adjust your browser's window size, and notice how the font size changes as the width crosses the different [breakpoints](/layout/breakpoints/):

{{"demo": "pages/customization/themes/ResponsiveFonts.js"}}
{{"demo": "pages/customization/themes/ResponsiveFontSizes.js"}}

To automate this setup, you can use the `responsiveTypography` helper in `@material-ui/core/styles` to make Typography font sizes in the theme responsive.
### Fluid font sizes

To be done: [#15251](https://github.com/mui-org/material-ui/issues/15251).

## Spacing

Expand Down Expand Up @@ -523,23 +542,32 @@ const theme = createMuiTheme({
});
```


### `responsiveTypography(typographySettings, options) => theme`
### `responsiveFontSizes(theme, options) => theme`

Generate responsive typography settings based on the options received.

#### Arguments

1. `typography` (*Object*): Typography settings as found in a material-ui theme
2. `options` (*Object*):
1. `theme` (*Object*): The theme object to enhance.
2. `options` (*Object* [optional]):

* `maxScale` (*number*): The scale that applies to the highest breakpoint
* `breakpointSettings` (*Object*): The breakpoint settings as found in a material-ui theme
* `breakpoints` (*Array<string>*) (optional): Array of [breakpoints](/layout/breakpoints/) (identifiers as defined by material-ui)
* `align` (*boolean*) (optional): Whether font sizes change slightly so line
- `breakpoints` (*Array<String>* [optional]): Default to `['sm', 'md', 'lg']`. Array of [breakpoints](/layout/breakpoints/) (identifiers).
- `disableAlign` (*Boolean* [optional]): Default to `false`. Whether font sizes change slightly so line
heights are preserved and align to Material Design's 4px line height grid.
This requires a unitless line height in the theme's styles.
- `factor` (*Number* [optional]): Default to `2`. This value determines the strength of font size resizing. The higher the value, the less difference there is between font sizes on small screens.
The lower the value, the bigger font sizes for small screens. The value must me greater than 1.
- `variants` (*Array<String>* [optional]): Default to all. The typography variants to handle.

#### Returns

`typography` (*Object*): Responsive typography settings to be used in a material-ui theme.
`theme` (*Object*): The new theme with a responsive typography.

#### Examples

```js
import { createMuiTheme, responsiveFontSizes } from '@material-ui/core/styles';

let theme = createMuiTheme();
theme = responsiveFontSizes(theme);
```
1 change: 0 additions & 1 deletion docs/webpackBaseConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ module.exports = {
'@material-ui/styles': path.resolve(__dirname, '../packages/material-ui-styles/src'),
'@material-ui/utils': path.resolve(__dirname, '../packages/material-ui-utils/src'),
'@material-ui/system': path.resolve(__dirname, '../packages/material-ui-system/src'),
'@material-ui/css-utils': path.resolve(__dirname, '../packages/material-ui-css-utils/src'),
docs: path.resolve(__dirname, '../docs'),
},
},
Expand Down
58 changes: 0 additions & 58 deletions packages/material-ui-css-utils/README.md

This file was deleted.

19 changes: 0 additions & 19 deletions packages/material-ui-css-utils/docs/README.hbs

This file was deleted.

49 changes: 0 additions & 49 deletions packages/material-ui-css-utils/package.json

This file was deleted.

8 changes: 0 additions & 8 deletions packages/material-ui-css-utils/src/alignProperty.js

This file was deleted.

24 changes: 0 additions & 24 deletions packages/material-ui-css-utils/src/alignProperty.test.js

This file was deleted.

8 changes: 0 additions & 8 deletions packages/material-ui-css-utils/src/fontGrid.js

This file was deleted.

32 changes: 0 additions & 32 deletions packages/material-ui-css-utils/src/fontGrid.test.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/material-ui-css-utils/src/index.js

This file was deleted.

Loading

0 comments on commit 85d4b3c

Please sign in to comment.