Skip to content
Merged
990 changes: 895 additions & 95 deletions __tests__/fixtures/tailwind-output.css

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions defaultConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,16 +410,19 @@ module.exports = {
| is provided, it will be made available as the non-suffixed `.rounded`
| utility.
|
| Class name: .rounded{-radius?}
| If your scale includes a `0` value to reset already rounded corners, it's
| a good idea to put it first so other values are able to override it.
|
| Class name: .rounded{-side?}{-size?}
|
*/

borderRadius: {
default: '.25rem',
'none': '0',
'sm': '.125rem',
default: '.25rem',
'lg': '.5rem',
'full': '9999px',
'none': '0',
},


Expand Down
298 changes: 238 additions & 60 deletions docs/source/docs/border-radius.blade.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/source/docs/examples/alerts.blade.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ description: null

@component('_partials.code-sample', ['lang' => 'html'])
<div role="alert">
<div class="bg-red text-white font-bold rounded rounded-t px-4 py-2">
<div class="bg-red text-white font-bold rounded-t px-4 py-2">
Danger
</div>
<div class="border border-t-0 border-red-light rounded rounded-b bg-red-lightest px-4 py-3 text-red-dark">
<div class="border border-t-0 border-red-light rounded-b bg-red-lightest px-4 py-3 text-red-dark">
<p>Something not ideal might be happening.</p>
</div>
</div>
Expand All @@ -52,7 +52,7 @@ description: null
### Top Accent Border

@component('_partials.code-sample', ['lang' => 'html'])
<div class="bg-teal-lightest border-t-4 border-teal rounded rounded-b text-teal-darkest px-4 py-3 shadow-md" role="alert">
<div class="bg-teal-lightest border-t-4 border-teal rounded-b text-teal-darkest px-4 py-3 shadow-md" role="alert">
<div class="flex">
<svg class="h-6 w-6 text-teal mr-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm12.73-1.41A8 8 0 1 0 4.34 4.34a8 8 0 0 0 11.32 11.32zM9 11V9h2v6H9v-4zm0-6h2v2H9V5z"/></svg>
<div>
Expand Down
8 changes: 4 additions & 4 deletions docs/source/docs/examples/buttons.blade.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,20 @@ description: null
</button>
@endcomponent

### Button Groups
### Groups

@component('_partials.code-sample', ['lang' => 'html', 'class' => 'text-center'])
<div class="inline-flex">
<button class="bg-smoke hover:bg-smoke-dark text-slate-dark font-bold py-2 px-4 rounded rounded-l">
<button class="bg-smoke hover:bg-smoke-dark text-slate-dark font-bold py-2 px-4 rounded-l">
Prev
</button>
<button class="bg-smoke hover:bg-smoke-dark text-slate-dark font-bold py-2 px-4 rounded rounded-r">
<button class="bg-smoke hover:bg-smoke-dark text-slate-dark font-bold py-2 px-4 rounded-r">
Next
</button>
</div>
@endcomponent

### w/Icon
### Icons

@component('_partials.code-sample', ['lang' => 'html', 'class' => 'text-center'])
<button class="bg-smoke hover:bg-smoke-dark text-slate-dark font-bold py-2 px-4 rounded inline-flex items-center">
Expand Down
4 changes: 2 additions & 2 deletions docs/source/docs/examples/cards.blade.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ description: null

@component('_partials.code-sample', ['class' => 'p-10 flex justify-center'])
<div class="max-w-md w-full lg:flex">
<div class="h-48 lg:h-auto lg:w-48 flex-none bg-cover rounded rounded-t lg:rounded lg:rounded-l text-center overflow-hidden" style="background-image: url('{{ $page->baseUrl }}/img/card-left.jpg')" title="Woman holding a mug">
<div class="h-48 lg:h-auto lg:w-48 flex-none bg-cover rounded-t lg:rounded-t-none lg:rounded-l text-center overflow-hidden" style="background-image: url('{{ $page->baseUrl }}/img/card-left.jpg')" title="Woman holding a mug">
</div>
<div class="border-r border-b border-l border-grey-light lg:border-l-0 lg:border-t lg:border-grey-light bg-white rounded rounded-b lg:rounded lg:rounded-r p-4 flex flex-col justify-between leading-normal">
<div class="border-r border-b border-l border-grey-light lg:border-l-0 lg:border-t lg:border-grey-light bg-white rounded-b lg:rounded-b-none lg:rounded-r p-4 flex flex-col justify-between leading-normal">
<div class="mb-8">
<p class="text-sm text-grey-dark flex items-center">
<svg class="text-grey w-3 h-3 mr-2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
Expand Down
2 changes: 1 addition & 1 deletion docs/source/docs/examples/navigation.blade.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ description: null
@component('_partials.code-sample')
<ul class="list-reset flex border-b">
<li class="-mb-px mr-1">
<a class="bg-white inline-block border-l border-t border-r rounded rounded-t py-2 px-4 text-blue-dark font-semibold" href="#">Active</a>
<a class="bg-white inline-block border-l border-t border-r rounded-t py-2 px-4 text-blue-dark font-semibold" href="#">Active</a>
</li>
<li class="mr-1">
<a class="bg-white inline-block py-2 px-4 text-blue hover:text-blue-darker font-semibold" href="#">Tab</a>
Expand Down
4 changes: 2 additions & 2 deletions docs/source/docs/functions-and-directives.blade.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Use the `@@tailwind` directive to insert Tailwind's `preflight`, `utilities` and
/**
* Use this directive to control where Tailwind injects the responsive
* variations of each utility.
*
* If omitted, Tailwind will append these classes to the very end of
*
* If omitted, Tailwind will append these classes to the very end of
* your stylesheet by default.
*/
@@tailwind screens;
Expand Down
10 changes: 8 additions & 2 deletions docs/tailwind.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,14 @@ config.padding = Object.assign(config.padding, {
'80': '20rem',
})

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

config.negativeMargin = config.padding
config.negativeMargin = config.margin

module.exports = config
53 changes: 31 additions & 22 deletions src/generators/rounded.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,44 @@
import _ from 'lodash'
import defineClass from '../util/defineClass'
import defineClasses from '../util/defineClasses'

function sideVariants() {
function sizedBorder(radius, modifier) {
modifier = modifier === 'default' ? '' : `-${modifier}`

return defineClasses({
'rounded-t': {
'border-bottom-right-radius': '0',
'border-bottom-left-radius': '0',
[`rounded${modifier}`]: {
'border-radius': `${radius}`,
},
[`rounded-t${modifier}`]: {
'border-top-left-radius': `${radius}`,
'border-top-right-radius': `${radius}`,
},
[`rounded-r${modifier}`]: {
'border-top-right-radius': `${radius}`,
'border-bottom-right-radius': `${radius}`,
},
[`rounded-b${modifier}`]: {
'border-bottom-right-radius': `${radius}`,
'border-bottom-left-radius': `${radius}`,
},
[`rounded-l${modifier}`]: {
'border-top-left-radius': `${radius}`,
'border-bottom-left-radius': `${radius}`,
},
[`rounded-tl${modifier}`]: {
'border-top-left-radius': `${radius}`,
},
'rounded-r': {
'border-bottom-left-radius': '0',
'border-top-left-radius': '0',
[`rounded-tr${modifier}`]: {
'border-top-right-radius': `${radius}`,
},
'rounded-b': {
'border-top-left-radius': '0',
'border-top-right-radius': '0',
[`rounded-br${modifier}`]: {
'border-bottom-right-radius': `${radius}`,
},
'rounded-l': {
'border-top-right-radius': '0',
'border-bottom-right-radius': '0',
[`rounded-bl${modifier}`]: {
'border-bottom-left-radius': `${radius}`,
},
})
}

module.exports = function({ borderRadius }) {
return _(borderRadius)
.map((radius, modifier) => {
return defineClass(modifier === 'default' ? 'rounded' : `rounded-${modifier}`, {
'border-radius': radius,
})
})
.concat(sideVariants())
.value()
return _.flatMap(borderRadius, sizedBorder)
}