Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.
Open
Show file tree
Hide file tree
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
162 changes: 90 additions & 72 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,80 +1,98 @@
<html>
<head>
<title>CSS skin</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link type="text/css" rel="stylesheet" href="skin.css">
</head>
<body>
<div>
<section id="intro">
<h2 id="intro_heading">CSS Components</h2>
</section>
<section id="button">
<h2 id="button_heading">Button</h2>
<p>A button is most typically used to trigger a custom JavaScript action (e.g. fetch new results, open a dialog or expand a menu).</p>
<p>A button may also be used, without JavaScript, to submit or reset a form.</p>

<h3>Default Button</h3>
<p>Use the <span class="highlight">btn</span> class on a button element to create the default button.</p>
<p>On hover, the text in the button should <strong>not</strong> be underlined.</p>
<div class="demo">
<p>It currently looks like this: </p>
<button class="btn">Button</button>
</div>
<div class="expected">
<p>It should eventually look like this: </p>
<img src="./img/button.png" />
</div>
<head>
<title>CSS skin</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link type="text/css" rel="stylesheet" href="skin.min.css">
</head>

<h3>Primary Button</h3>
<p>Use the <span class="highlight">btn--primary</span> hierarchy modifier to create a primary button.</p>
<p>This means that you will use both <span class="highlight">btn</span> and <span class="highlight">btn--primary</span> classes.</p>
<div class="demo">
<p>It currently looks like this: </p>
<button class="btn btn--primary">Button</button>
</div>
<div class="expected">
<p>It should eventually look like this: </p>
<img src="./img/primary-button.png" />
</div>
<body>
<div>
<section id="intro">
<h2 id="intro_heading">CSS Components</h2>
</section>
<section id="button">
<h2 id="button_heading">Button</h2>
<p>A button is most typically used to trigger a custom JavaScript action (e.g. fetch new results, open a dialog
or expand a menu).</p>
<p>A button may also be used, without JavaScript, to submit or reset a form.</p>

<h3>Secondary Button</h3>
<p>Use the <span class="highlight">btn--secondary</span> hierarchy modifier to create a secondary button.</p>
<p>This means that you will use both <span class="highlight">btn</span> and <span class="highlight">btn--secondary</span> classes.</p>
<div class="demo">
<p>It currently looks like this: </p>
<button class="btn btn--secondary">Button</button>
</div>
<div class="expected">
<p>It should eventually look like this: </p>
<img src="./img/secondary-button.png" />
</div>
<h3>Default Button</h3>
<p>Use the
<span class="highlight">btn</span> class on a button element to create the default button.</p>
<p>On hover, the text in the button should
<strong>not</strong> be underlined.</p>
<div class="demo">
<p>It currently looks like this: </p>
<button class="btn">Button</button>
</div>
<div class="expected">
<p>It should eventually look like this: </p>
<img src="./img/button.png" />
</div>

<h3>Large Button</h3>
<p>Use the <span class="highlight">btn--large</span> size modifier to create a large button.</p>
<p>This means that you will use both <span class="highlight">btn</span> and <span class="highlight">btn--large</span> classes.</p>
<div class="demo">
<p>It currently looks like this: </p>
<button class="btn btn--large">Button</button>
</div>
<div class="expected">
<p>It should eventually look like this: </p>
<img src="./img/large-button.png" />
</div>
<h3>Primary Button</h3>
<p>Use the
<span class="highlight">btn--primary</span> hierarchy modifier to create a primary button.</p>
<p>This means that you will use both
<span class="highlight">btn</span> and
<span class="highlight">btn--primary</span> classes.</p>
<div class="demo">
<p>It currently looks like this: </p>
<button class="btn btn--primary">Button</button>
</div>
<div class="expected">
<p>It should eventually look like this: </p>
<img src="./img/primary-button.png" />
</div>

<h3>Extra-Large Button</h3>
<p>Use the <span class="highlight">btn--extra-large</span> size modifier to create an extra large button.</p>
<p>This means that you will use both <span class="highlight">btn</span> and <span class="highlight">btn--extra-large</span> classes.</p>
<div class="demo">
<p>It currently looks like this: </p>
<button class="btn btn--extra-large">Button</button>
</div>
<div class="expected">
<p>It should eventually look like this: </p>
<img src="./img/extra-large-button.png" />
</div>
<h3>Secondary Button</h3>
<p>Use the
<span class="highlight">btn--secondary</span> hierarchy modifier to create a secondary button.</p>
<p>This means that you will use both
<span class="highlight">btn</span> and
<span class="highlight">btn--secondary</span> classes.</p>
<div class="demo">
<p>It currently looks like this: </p>
<button class="btn btn--secondary">Button</button>
</div>
<div class="expected">
<p>It should eventually look like this: </p>
<img src="./img/secondary-button.png" />
</div>

<h3>Large Button</h3>
<p>Use the
<span class="highlight">btn--large</span> size modifier to create a large button.</p>
<p>This means that you will use both
<span class="highlight">btn</span> and
<span class="highlight">btn--large</span> classes.</p>
<div class="demo">
<p>It currently looks like this: </p>
<button class="btn btn--large">Button</button>
</div>
<div class="expected">
<p>It should eventually look like this: </p>
<img src="./img/large-button.png" />
</div>

<h3>Extra-Large Button</h3>
<p>Use the
<span class="highlight">btn--extra-large</span> size modifier to create an extra large button.</p>
<p>This means that you will use both
<span class="highlight">btn</span> and
<span class="highlight">btn--extra-large</span> classes.</p>
<div class="demo">
<p>It currently looks like this: </p>
<button class="btn btn--extra-large">Button</button>
</div>
<div class="expected">
<p>It should eventually look like this: </p>
<img src="./img/extra-large-button.png" />
</div>

</section>
</div>
</body>

</section>
</div>
</body>
</html>
78 changes: 65 additions & 13 deletions skin.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,65 @@
.highlight {
background-color: #ddd;
}

button.btn {
border-radius: 3px;
border-style: solid;
border-width: 1px;
font-weight: normal;
line-height: 1.15;
text-align: center;
vertical-align: middle;
}
.demo .btn {
font-size: 1rem;
padding: 1rem;
border-radius: 5px;
border-style: solid;
border-width: 1px;
font-weight: normal;
line-height: 1.15;
background: #fff;
color: #288ad6;
width: 11rem;
}

.demo .btn--primary {
font-size: 1rem;
padding: 1rem;
border-radius: 5px;
border-style: solid;
border-width: 1px;
font-weight: normal;
line-height: 1.15;
background: #015494;
color: #fff;
width: 11rem;
}

.demo .btn--secondary {
font-size: 1rem;
padding: 1rem;
border-radius: 5px;
border-style: solid;
border-width: 1px;
font-weight: normal;
line-height: 1.15;
background: #f8f5f5;
color: #7a7a7a;
width: 11rem;
border-color: #575555;
}

.demo .btn--large {
font-size: 1.4rem;
padding: 1.3rem;
border-radius: 5px;
border-style: solid;
border-width: 1px;
font-weight: normal;
line-height: 1.15;
background: #fff;
color: #288ad6;
width: 17rem;
}

.demo .btn--extra-large {
font-size: 1.6rem;
padding: 1.5rem;
border-radius: 5px;
border-style: solid;
border-width: 1px;
font-weight: normal;
line-height: 1.15;
background: #fff;
color: #288ad6;
width: 22rem;
}
1 change: 1 addition & 0 deletions skin.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions skin.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@mixin btn__style(
$bck-color,
$txt-color,
$btn-width,
$btn-padding,
$btn-font-size
) {
font-size: $btn-font-size;
padding: $btn-padding;
border-radius: 5px;
border-style: solid;
border-width: 1px;
font-weight: normal;
line-height: 1.15;
background: $bck-color;
color: $txt-color;
width: $btn-width;
}

.demo {
.btn {
@include btn__style(#fff, #288ad6, 11rem, 1rem, 1rem);
}

.btn--primary {
@include btn__style(#015494, #fff, 11rem, 1rem, 1rem);
}

.btn--secondary {
@include btn__style(
rgb(248, 245, 245),
rgb(122, 122, 122),
11rem,
1rem,
1rem
);
border-color: rgb(87, 85, 85);
}

.btn--large {
@include btn__style(#fff, #288ad6, 17rem, 1.3rem, 1.4rem);
}

.btn--extra-large {
@include btn__style(#fff, #288ad6, 22rem, 1.5rem, 1.6rem);
}
}