-
Notifications
You must be signed in to change notification settings - Fork 22
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
migrate v4 components to use v4.4.0 colors and utilities (current v4.0.0) #92
Comments
Hi @kohsei-ishihara, Hopefully, everything can be tuned using themization. If you failed to do that, would you mind sharing a reproduction on codesandbox.io and giving more details about the issue you are facing?
etc... Generally, you are free to use the
Using props themeimport { makeTheme } from 'bootstrap-styled/lib/theme';
import Button from '@bootstrap-styled/v4/lib/Button';
const myTheme = makeTheme({
'$blue': '#007bff';
'$indigo': '#6610f2';
'$purple': '#6f42c1';
'$pink': '#e83e8c';
'$red': '#dc3545';
'$orange': '#fd7e14';
'$yellow': '#ffc107';
'$green': '#28a745';
'$teal': '#20c997';
'$cyan': '#17a2b8';
'$white': '#fff';
'$gray': '#6c757d';
'$gray-dark': '#343a40';
'$primary': '#007bff';
'$secondary': '#6c757d';
'$success': '#28a745';
'$info': '#17a2b8';
'$warning': '#ffc107';
'$danger': '#dc3545';
'$light': '#f8f9fa';
'$dark': '#343a40';
});
const MyButton = (props) => <Button {...props} theme={myTheme} /> Using BootstrapProviderimport BootstrapProvider from '@bootstrap-styled/provider';
import Button from '@bootstrap-styled/v4/lib/Button';
const myTheme = {
'$blue': '#007bff';
'$indigo': '#6610f2';
'$purple': '#6f42c1';
'$pink': '#e83e8c';
'$red': '#dc3545';
'$orange': '#fd7e14';
'$yellow': '#ffc107';
'$green': '#28a745';
'$teal': '#20c997';
'$cyan': '#17a2b8';
'$white': '#fff';
'$gray': '#6c757d';
'$gray-dark': '#343a40';
'$primary': '#007bff';
'$secondary': '#6c757d';
'$success': '#28a745';
'$info': '#17a2b8';
'$warning': '#ffc107';
'$danger': '#dc3545';
'$light': '#f8f9fa';
'$dark': '#343a40';
};
const MyButton = (props) => <BootstrapProvider theme={myTheme}><Button {...props} /></BoostrapProvider>; Using props
|
I used BootsrapProvider and worked wrong. const myTheme = {
'$blue': '#007bff',
'$indigo': '#6610f2',
'$purple': '#6f42c1',
'$pink': '#e83e8c',
'$red': '#dc3545',
'$orange': '#fd7e14',
'$yellow': '#ffc107',
'$green': '#28a745',
'$teal': '#20c997',
'$cyan': '#17a2b8',
'$white': '#fff',
'$gray': '#6c757d',
'$gray-dark': '#343a40',
'$primary': '#007bff',
'$secondary': '#6c757d',
'$success': '#28a745',
'$info': '#17a2b8',
'$warning': '#ffc107',
'$danger': '#dc3545',
'$light': '#f8f9fa',
'$dark': '#343a40'
} <BootstrapProvider theme={myTheme}>
<Button color="primary">test</Button>
<Button color="primary" outline>test</Button>
<Alert color="primary">test</Alert>
<Button color="secondary">test</Button>
<Button color="secondary" outline>test</Button>
<Alert color="secondary">test</Alert>
<Button color="success">test</Button>
<Button color="success" outline>test</Button>
<Alert color="success">test</Alert>
<Button color="info">test</Button>
<Button color="info" outline>test</Button>
<Alert color="info">test</Alert>
<Button color="warning">test</Button>
<Button color="warning" outline>test</Button>
<Alert color="warning">test</Alert>
<Button color="danger">test</Button>
<Button color="danger" outline>test</Button>
<Alert color="danger">test</Alert>
<Button color="light">test</Button>
<Button color="light" outline>test</Button>
<Alert color="light">test</Alert>
<Button color="dark">test</Button>
<Button color="dark" outline>test</Button>
<Alert color="dark">test</Alert>
</BootstrapProvider> |
Hi @kohsei-ishihara, Unfortunately, when we started the lib the v4 was still in alpha. We have begun the transition towards the actual v4 but we won't be able to release it yet. |
BREAKING CHANGE deprecate old utilities, they will be removed in futur version. Please now use new variant. If necessary, enabled old implementation back as described in the documentation BREAKING CHANGE: align, background, border, clearfix, display, flex, float, position, screenreaders, sizing, spacing, text, visibility are now disabled. display and media have been added and can be used to replace. They also migrated the theme colors, so far we keep using $brand-primary for v4 components, but they now use $primary, etc... names and if you want to get those utilities with the proper colors, you will need to use the new naming convention. (in addition of the old naming convention until they get removed and unused from v4 and others libs) re bootstrap-styled/v4#92
@kohsei-ishihara I have implemented the
import { theme } from 'bootstrap-styled';
import BootstrapProvider from '@bootstrap-styled/provider';
ReactDOM.render(
<BootstrapProvider theme={theme} utils={{
// v4.4.0 implementation: new behavior, it is now enabled by default
screen: false,
print: false,
// v4.0.0 implementation: old behavior, now disabled by default, it will be removed in futur version
align: true,
background: true,
border: true,
display: true,
flex: true,
float: true,
position: true,
screenreaders: true,
sizing: true,
spacing: true,
text: true,
visibility: true,
}}>
<App />
</BootstrapProvider>
document.getElementById('app')
); See https://github.com/bootstrap-styled/provider/pull/49/files and https://github.com/bootstrap-styled/provider/releases/tag/v2.0.0 for more details. You can now use those colors schema. You might get warning if you use colors that are not supported by components props, so prefer the I leave the issue open until all v4 components get migrated. Questions and remarks are welcomed. |
# [2.0.0](v1.5.3...v2.0.0) (2019-12-02) ### Features * **utilities:** update utilities to v4.4.0 ([8cf8216](8cf8216)) ### BREAKING CHANGES * **utilities:** deprecate old utilities, they will be removed in futur version. Please now use new variant. If necessary, enabled old implementation back as described in the documentation * **utilities:** align, background, border, clearfix, display, flex, float, position, screenreaders, sizing, spacing, text, visibility are now disabled. display and media have been added and can be used to replace. They also migrated the theme colors, so far we keep using $brand-primary for v4 components, but they now use $primary, etc... names and if you want to get those utilities with the proper colors, you will need to use the new naming convention. (in addition of the old naming convention until they get removed and unused from v4 and others libs) re bootstrap-styled/v4#92
v4
Before opening a new issue, please take a moment to review our community guidelines to make the contribution process easy and effective for everyone involved.
Before opening a new issue, you may find an answer in already closed issues:
https://github.com/bootstrap-styled/v4/issues?q=is%3Aissue+is%3Aclosed
Issue Type
Description
Thank you for the useful component you made. I tried to use this but colors are totally different from bootstrap v4 and I can't use this raw.
https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.css
Steps to reproduce
Versions
The text was updated successfully, but these errors were encountered: