Skip to content

Commit db6d65c

Browse files
committed
Add invisible button
Unchanged from dotcom
1 parent 0e55872 commit db6d65c

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

docs/content/components/buttons.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,15 @@ Create a button that looks like a link with `.btn-link`. Rather than using an `<
118118
<button class="btn-link" type="button">Link button</button>
119119
```
120120

121+
## Invisible button
122+
123+
When you want a link, but you want it padded and line heighted like a button best for "cancel" actions on forms.
124+
125+
```html live
126+
<button class="btn btn-invisible" type="button">Cancel</button>
127+
<button class="btn" type="button">Submit</button>
128+
```
129+
121130
## Close button
122131

123132
When using the `octicon-x` icon for a close button, add `.close-button` to remove the default button styles.

src/buttons/button.scss

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,27 @@
131131
}
132132
}
133133
}
134+
135+
// Invisible button
136+
//
137+
// Typically used as a "cancel" button next to a .btn
138+
.btn-invisible {
139+
color: $text-blue;
140+
background-color: $bg-white; // Reset default gradient backgrounds and colors
141+
background-image: none;
142+
border: 0;
143+
144+
// stylelint-disable-next-line primer/no-override
145+
&:hover,
146+
&:active,
147+
&:focus,
148+
&.selected,
149+
&.zeroclipboard-is-hover,
150+
&.zeroclipboard-is-active {
151+
color: $text-blue;
152+
background: none;
153+
outline: none;
154+
// stylelint-disable-next-line primer/variables
155+
box-shadow: none;
156+
}
157+
}

0 commit comments

Comments
 (0)