-
Notifications
You must be signed in to change notification settings - Fork 52
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
SASS variable overrides #13
Comments
You can build CSS with custom variables. import './css/bulma.css'
export { default as Box } from 'reactbulma/Box/Box'
export { default as Button } from 'reactbulma/Button/Button'
//... |
This is the code that I needed to use: // components/index.js
// processed somehow
import './bulma.css'
export { default as Box } from 'reactbulma/lib/components/Box/Box'
export { default as Button } from 'reactbulma/lib/components/Button/Button'
export { default as Card } from 'reactbulma/lib/components/Card/Card'
export { default as Checkbox } from 'reactbulma/lib/components/Checkbox/Checkbox'
export { default as Container } from 'reactbulma/lib/components/Container/Container'
export { default as Content } from 'reactbulma/lib/components/Content/Content'
export { default as Control } from 'reactbulma/lib/components/Control/Control'
export { default as Delete } from 'reactbulma/lib/components/Delete/Delete'
export { default as Field } from 'reactbulma/lib/components/Field/Field'
export { default as Heading } from 'reactbulma/lib/components/Heading/Heading'
export { default as Hero } from 'reactbulma/lib/components/Hero/Hero'
export { default as Icon } from 'reactbulma/lib/components/Icon/Icon'
export { default as Image } from 'reactbulma/lib/components/Image/Image'
export { default as Input } from 'reactbulma/lib/components/Input/Input'
export { default as Level } from 'reactbulma/lib/components/Level/Level'
export { default as Link } from 'reactbulma/lib/components/Link/Link'
export { default as Media } from 'reactbulma/lib/components/Media/Media'
export { default as Message } from 'reactbulma/lib/components/Message/Message'
export { default as Nav } from 'reactbulma/lib/components/Nav/Nav'
export { default as Notification } from 'reactbulma/lib/components/Notification/Notification'
export { default as Panel } from 'reactbulma/lib/components/Panel/Panel'
export { default as Progress } from 'reactbulma/lib/components/Progress/Progress'
export { default as Section } from 'reactbulma/lib/components/Section/Section'
export { default as Table } from 'reactbulma/lib/components/Table/Table'
export { default as Tabs } from 'reactbulma/lib/components/Tabs/Tabs'
export { default as Tag } from 'reactbulma/lib/components/Tag/Tag'
export { default as Textarea } from 'reactbulma/lib/components/Textarea/Textarea'
export { default as Title } from 'reactbulma/lib/components/Title/Title'
export { default as SubTitle } from 'reactbulma/lib/components/Title/Subtitle' And in files referencing these components: import { Button } from '../components'
// instead of
// import { Button } from 'reactbulma' |
I am not a huge fan of this. I thought that the user could install bulma themselves and customize it the way the docs have it. Then react-bulma was just consuming the classnames. For example I almost always do this when using bulma
Now all the colors are changed everywhere. Being able to require the sass version of bulma would aslo mean that people can just require |
^ I realized after thinking about this that it wouldn't be realistic to add a buildstep/api to consume the sass version of bulma. Instead I think that the |
I can't get this to work, even with a custom sass file with variable overrides. It's still the same default |
This worked for me: import 'bulma/css/bulma.css' // Your custom bulma css
export { default as Box } from 'reactbulma/lib/components/Box/Box'
export { default as Button } from 'reactbulma/lib/components/Button/Button'
export { default as Card } from 'reactbulma/lib/components/Card/Card'
export { default as Checkbox } from 'reactbulma/lib/components/Checkbox/Checkbox'
export { default as Container } from 'reactbulma/lib/components/Container/Container'
export { default as Content } from 'reactbulma/lib/components/Content/Content'
export { default as Control } from 'reactbulma/lib/components/Control/Control'
export { default as Delete } from 'reactbulma/lib/components/Delete/Delete'
export { default as Field } from 'reactbulma/lib/components/Field/Field'
export { default as Heading } from 'reactbulma/lib/components/Heading/Heading'
export { default as Hero } from 'reactbulma/lib/components/Hero/Hero'
export { default as Icon } from 'reactbulma/lib/components/Icon/Icon'
export { default as Image } from 'reactbulma/lib/components/Image/Image'
export { default as Input } from 'reactbulma/lib/components/Input/Input'
export { default as Level } from 'reactbulma/lib/components/Level/Level'
export { default as Link } from 'reactbulma/lib/components/Link/Link'
export { default as Media } from 'reactbulma/lib/components/Media/Media'
export { default as Message } from 'reactbulma/lib/components/Message/Message'
export { default as Nav } from 'reactbulma/lib/components/Nav/Nav'
export { default as Notification } from 'reactbulma/lib/components/Notification/Notification'
export { default as Panel } from 'reactbulma/lib/components/Panel/Panel'
export { default as Progress } from 'reactbulma/lib/components/Progress/Progress'
export { default as Section } from 'reactbulma/lib/components/Section/Section'
export { default as Table } from 'reactbulma/lib/components/Table/Table'
export { default as Tabs } from 'reactbulma/lib/components/Tabs/Tabs'
export { default as Tag } from 'reactbulma/lib/components/Tag/Tag'
export { default as Textarea } from 'reactbulma/lib/components/Textarea/Textarea'
export { default as Title } from 'reactbulma/lib/components/Title/Title'
export { default as SubTitle } from 'reactbulma/lib/components/Title/SubTitle' |
First off, thanks for creating this project! I am beginning to use it and it has been very easy to integrate. I was wondering if you've thought about a way to implement overrides for any of the SASS variables in Bulma? What comes to mind is overriding what the
primary
color is or the defaultfont-family
.I'd be happy to help with this, but I don't know what that implementation would look like.
The text was updated successfully, but these errors were encountered: