Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: streamline SCSS variables and mixins #1905

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/backstop_data
/dist
Binary file added src/images/Icon-Burger-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/Icon-Close.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/Phone-number.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/header-bg-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
174 changes: 155 additions & 19 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,158 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<title>Landing Page</title>
<link
rel="stylesheet"
href="./styles/main.scss"
/>
<script
src="scripts/main.js"
defer
></script>
</head>
<body>
<h1>Landing Page</h1>
</body>
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<title>Product cards</title>
<link
rel="stylesheet"
href="styles/index.css"
/>
</head>

<body class="page">
<div class="page__body">
<h1>Page</h1>

<header class="header">
<div class="top-bar">
<a href="#">
<img
src="images/Logo.png"
alt="Bose logo"
class="top-bar__logo"
/>
</a>

<div class="top-bar__icons">
<a
href="#"
class="icon icon--phone"
></a>
<a
href="#menu"
class="icon icon--menu"
></a>
</div>
</div>

<div class="header__bottom">
<h1 class="header__title">
Your senses.
<br />
Set free.
</h1>
</div>
</header>

<aside
class="menu page__menu"
id="menu"
>
<div class="top-bar">
<a href="#">
<img
src="images/Logo.png"
alt="Bose logo"
class="top-bar__logo"
/>
</a>
<div class="top-bar__icons">
<a
href="#"
class="icon icon--close"
></a>
</div>
</div>

<div class="menu__content">
<nav class="nav menu__nav">
<ul class="nav__list">
<li class="nav__item">
<a
class="nav__linc"
href="#recommended"
>
Recommended
</a>
</li>
<li class="nav__item">
<a
class="nav__linc"
href="#categories"
>
Categories
</a>
</li>
<li class="nav__item">
<a
class="nav__linc"
href="#about-us"
>
About Us
</a>
</li>
<li class="nav__item">
<a
class="nav__linc"
href="#contacts"
>
Contact Us
</a>
</li>
</ul>
</nav>

<a
href="tel:+1 234 5555-55-55"
class="menu__phone-number"
>
+1 234 5555-55-55
</a>

<a
href="#"
class="menu__call-to-order"
>
call to order
</a>
</div>
</aside>

<main>
<section
class="recommended"
id="recommended"
>
<h2>Recommended</h2>
</section>

<section
class="categories"
id="categories"
>
<h2>Categories</h2>
</section>

<section
class="about"
id="about-us"
>
<h2>About Us</h2>
</section>

<section
class="contacts"
id="contacts"
>
<h2>Contact Us</h2>
</section>
</main>
</div>

<footer class="footer"></footer>
</body>
</html>
24 changes: 24 additions & 0 deletions src/styles/blocks/header.css

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

1 change: 1 addition & 0 deletions src/styles/blocks/header.css.map

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

24 changes: 24 additions & 0 deletions src/styles/blocks/header.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.header {
box-sizing: border-box;
height: 100vh;
background-size: cover;
background-position: center;
background-image: url('../images/header-bg-mobile.png');

display: flex;
flex-direction: column;
justify-content: space-between;

&__title {
font-weight: $main-font-weight-bold;
font-size: 36px;
line-height: 36px;
color: #fff;
margin: 0;
}

&__bottom {
padding-bottom: 40px;
@include constentPaddingInline;
}
}
16 changes: 16 additions & 0 deletions src/styles/blocks/icon.css

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

1 change: 1 addition & 0 deletions src/styles/blocks/icon.css.map

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

24 changes: 24 additions & 0 deletions src/styles/blocks/icon.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.icon {
display: block;
width: 24px;
height: 24px;
background-repeat: no-repeat;
background-size: cover;

@include onTablet {
height: 32px;
width: 32px;
}

&--phone {
background-image: url(/src/images/Phone-number.png);
}

&--menu {
background-image: url(/src/images/Icon-Burger-menu.png);
}

&--close {
background-image: url(/src/images/Icon-Close.png);
}
}
38 changes: 38 additions & 0 deletions src/styles/blocks/menu.css

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

1 change: 1 addition & 0 deletions src/styles/blocks/menu.css.map

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

33 changes: 33 additions & 0 deletions src/styles/blocks/menu.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.menu {
box-sizing: border-box;
height: 100vh;
background-color: #f9f9f9;
font-weight: $main-font-weight-bold;
text-transform: uppercase;
letter-spacing: 1px;

&__nav {
margin-top: 60px;
}

&__content {
@include constentPaddingInline;
}

&__phone-number {
display: block;
color: inherit;
text-decoration: none;
margin-top: 48px;
}

&__call-to-order {
display: block;
width: fit-content;
color: inherit;
text-decoration: none;
margin-top: 16px;
padding-bottom: 4px;
border-bottom: 1px solid $main-text-color;
}
}
18 changes: 18 additions & 0 deletions src/styles/blocks/nav.css

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

1 change: 1 addition & 0 deletions src/styles/blocks/nav.css.map

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

20 changes: 20 additions & 0 deletions src/styles/blocks/nav.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.nav {
&__linc {
color: inherit;
text-decoration: none;
text-transform: none;

font-size: 22px;
letter-spacing: 1px;
}

&__list {
margin: 0;
padding: 0;
list-style: none;

display: flex;
flex-direction: column;
gap: 32px;
}
}
Loading