Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 12 additions & 19 deletions docs/tailwind.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
var config = require('../lib/index').defaultConfig()

config.colors = {
...config.colors,

config.colors = Object.assign(config.colors, {
Copy link
Member

Choose a reason for hiding this comment

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

Object.assign mutates the first object in the parameter list, so it isn't technically required to assign this back to the property. I can't decide if I think it's harmless or misleading.

If you want to do this in an immutable way, you can rewrite it like:

config.colors = Object.assign({}, config.colors, { ... })

Note the extra empty anonymous object as the first param.

Copy link
Member

Choose a reason for hiding this comment

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

Also this is just the docs config file so who fucking cares.

'slate-darker': '#212b35',
'slate-dark': '#404e5c',
'slate': '#647382',
Expand All @@ -18,7 +16,7 @@ config.colors = {
'tailwind-teal-light': '#5ebcca',
'tailwind-teal': '#44a8b3',
'tailwind-teal-dark': '#2f8696',
}
})

config.fonts = {
'sans': 'Aktiv Grotesk, aktiv-grotesk, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue',
Expand Down Expand Up @@ -55,35 +53,30 @@ config.textColors = config.colors

config.backgroundColors = config.colors

config.borderWidths = {
config.borderWidths = Object.assign(config.borderWidths, {
'6': '6px',
...config.borderWidths,
}
})

config.borderColors = {
config.borderColors = Object.assign(config.colors, {
default: config.colors['slate-lighter'],
...config.colors,
}
})

config.width = {
config.width = Object.assign(config.width, {
'5': '1.25rem',
'128': '32rem',
...config.width,
}
})

config.height = {
config.height = Object.assign(config.height, {
'7': '1.75rem',
...config.width,
}
})

config.padding = {
config.padding = Object.assign(config.padding, {
'10': '2.5rem',
'12': '3rem',
'16': '4rem',
'20': '5rem',
'80': '20rem',
...config.padding,
}
})

config.margin = config.padding

Expand Down