Skip to content

Commit 62f41f6

Browse files
committed
feat: style button by default #14
Closes #14
1 parent e28f7fa commit 62f41f6

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

src/createConfig.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,33 @@ const custom_css = `
7676
@media (max-width: 767px) {
7777
main { padding: 15px; }
7878
}
79+
80+
/**
81+
* GitHub Primer button CSS
82+
* https://primer.style/css/components/buttons
83+
**/
84+
.code-fence button {
85+
font-family: inherit;
86+
text-transform: none;
87+
position: relative;
88+
display: inline-block;
89+
padding: 5px 16px;
90+
font-size: 14px;
91+
font-weight: 500;
92+
line-height: 20px;
93+
white-space: nowrap;
94+
vertical-align: middle;
95+
cursor: pointer;
96+
user-select: none;
97+
border: 1px solid;
98+
border-radius: 6px;
99+
appearance: none;
100+
color: #24292e;
101+
background-color: #fafbfc;
102+
border-color: rgba(27,31,35,0.15);
103+
box-shadow: 0 1px 0 rgba(27,31,35,0.04), inset 0 1px 0 rgba(255,255,255,0.25);
104+
transition: background-color 0.2s cubic-bezier(0.3, 0, 0.5, 1);
105+
}
79106
`;
80107

81108
interface CreateConfigOptions {

src/preprocessReadme.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ export function preprocessReadme(opts: Partial<PreprocessReadmeOptions>): Pick<P
170170

171171
return {
172172
code: `<script>${script_content}</script>
173-
<style>${style_content}</style>
174-
<main class="markdown-body">${result}</main>`,
173+
<style>${style_content}</style>
174+
<main class="markdown-body">${result}</main>`,
175175
};
176176
},
177177
};

test/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Check out my cool component library.
3333
Increment the count
3434
</Button>
3535
36+
<button type="button">Button</button>
37+
3638
<h1>{count}</h1>
3739
3840
{#each items as item}

0 commit comments

Comments
 (0)