Skip to content

Commit 72607ec

Browse files
authored
Merge pull request tailwindlabs#32 from tailwindcss/add-outline-docs
Add barebones docs for outline-related stuff
2 parents 3f1dff3 + b35e65e commit 72607ec

File tree

5 files changed

+66
-9
lines changed

5 files changed

+66
-9
lines changed

navigation.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
'Appearance' => 'appearance',
8686
'Box Shadow' => 'shadows',
8787
'Opacity' => 'opacity',
88+
'Outline' => 'outline',
8889
'SVG' => 'svg',
8990
],
9091
'Component Examples' => [

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"postcss-cssnext": "^3.0.2",
2323
"prismjs": "^1.8.3",
2424
"stylefmt": "^6.0.0",
25-
"tailwindcss": "0.6.0",
25+
"tailwindcss": "0.6.1",
2626
"vue": "^2.5.2",
2727
"webpack-watch": "^0.2.0",
2828
"yargs": "^10.0.3"

source/docs/outline.blade.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
extends: _layouts.documentation
3+
title: "Outline"
4+
description: "Utilities for controlling an element's outline."
5+
---
6+
7+
@include('_partials.work-in-progress')
8+
9+
@include('_partials.class-table', [
10+
'rows' => [
11+
[
12+
'.outline-none',
13+
'outline: 0;',
14+
"Remove an element's outline.",
15+
],
16+
]
17+
])
18+
19+
20+
## Customizing
21+
22+
@include('_partials.variants-and-disabling', [
23+
'utility' => [
24+
'name' => 'outline',
25+
'property' => 'outline',
26+
],
27+
'variants' => ['focus'],
28+
])

source/docs/shadows.blade.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,27 @@ features:
1313
'rows' => [
1414
[
1515
'.shadow',
16-
"box-shadow:\n 0 2px 4px 0 rgba(0,0,0,0.10);",
16+
"box-shadow: 0 2px 4px 0 rgba(0,0,0,0.10);",
1717
"Apply a small box shadow to an element.",
1818
],
1919
[
2020
'.shadow-md',
21-
"box-shadow:\n 0 4px 8px 0 rgba(0,0,0,0.12),\n 0 2px 4px 0 rgba(0,0,0,0.08);",
21+
"box-shadow: 0 4px 8px 0 rgba(0,0,0,0.12),\n 0 2px 4px 0 rgba(0,0,0,0.08);",
2222
"Apply a medium box shadow to an element.",
2323
],
2424
[
2525
'.shadow-lg',
26-
"box-shadow:\n 0 15px 30px 0 rgba(0,0,0,0.11),\n 0 5px 15px 0 rgba(0,0,0,0.08);",
26+
"box-shadow: 0 15px 30px 0 rgba(0,0,0,0.11),\n 0 5px 15px 0 rgba(0,0,0,0.08);",
2727
"Apply a large box shadow to an element.",
2828
],
2929
[
3030
'.shadow-inner',
31-
"box-shadow:\n inset 0 2px 4px 0 rgba(0,0,0,0.06);",
31+
"box-shadow: inset 0 2px 4px 0 rgba(0,0,0,0.06);",
32+
"Apply a small inner box shadow to an element.",
33+
],
34+
[
35+
'.shadow-outline',
36+
"box-shadow: 2px solid rgba(52,144,220,0.5);",
3237
"Apply a small inner box shadow to an element.",
3338
],
3439
[
@@ -65,6 +70,24 @@ Use the `.shadow-inner` utility to apply a subtle inset box shadow to an element
6570
@endslot
6671
@endcomponent
6772

73+
## Outline shadow
74+
75+
Use the `.shadow-outline` utility to apply a focus-ring-style shadow to an element. This can be useful when combined with `.focus:outline-none` to create a better looking focus style that follows an element's border radius.
76+
77+
@component('_partials.code-sample', ['class' => 'flex justify-center text-sm py-8'])
78+
<button class="focus:outline-none focus:shadow-outline bg-grey-light hover:bg-grey text-grey-darkest font-bold py-2 px-4 rounded w-24 mr-6">
79+
Unfocused
80+
</button>
81+
<button class="focus:outline-none shadow-outline bg-grey-light hover:bg-grey text-grey-darkest font-bold py-2 px-4 rounded w-24">
82+
Focused
83+
</button>
84+
@slot('code')
85+
<button class="focus:outline-none focus:shadow-outline ...">
86+
Button
87+
</button>
88+
@endslot
89+
@endcomponent
90+
6891
## No shadow
6992

7093
Use `.shadow-none` to remove an existing box shadow from an element. This is most commonly used to remove a shadow that was applied at a smaller breakpoint.

yarn.lock

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,6 +1865,10 @@ css-what@2.1:
18651865
version "2.1.0"
18661866
resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.0.tgz#9467d032c38cfaefb9f2d79501253062f87fa1bd"
18671867

1868+
css.escape@^1.5.1:
1869+
version "1.5.1"
1870+
resolved "https://registry.yarnpkg.com/css.escape/-/css.escape-1.5.1.tgz#42e27d4fa04ae32f931a4b4d4191fa9cddee97cb"
1871+
18681872
css@^2.0.0:
18691873
version "2.2.1"
18701874
resolved "https://registry.yarnpkg.com/css/-/css-2.2.1.tgz#73a4c81de85db664d4ee674f7d47085e3b2d55dc"
@@ -7415,13 +7419,14 @@ table@^4.0.1:
74157419
slice-ansi "1.0.0"
74167420
string-width "^2.1.1"
74177421

7418-
tailwindcss@0.5.3:
7419-
version "0.5.3"
7420-
resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-0.5.3.tgz#5444f85ab5e68a37c2bf13bc4ac097a7ee05321d"
7422+
tailwindcss@0.6.1:
7423+
version "0.6.1"
7424+
resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-0.6.1.tgz#6fa250df581a044b3240a5b40e7beb281d56b41e"
74217425
dependencies:
74227426
commander "^2.11.0"
7427+
css.escape "^1.5.1"
74237428
fs-extra "^4.0.2"
7424-
lodash "^4.17.4"
7429+
lodash "^4.17.5"
74257430
perfectionist "^2.4.0"
74267431
postcss "^6.0.9"
74277432
postcss-functions "^3.0.0"

0 commit comments

Comments
 (0)