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

Calendar with wrong font #3952

Open
wants to merge 1 commit into
base: master
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
29 changes: 29 additions & 0 deletions .github/workflows/test.yml-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test

on:
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
- name: Upload HTML report(backstop data)
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: report
path: backstop_data
4,424 changes: 2,547 additions & 1,877 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"init": "mate-scripts init",
"start": "mate-scripts start",
"format": "prettier --ignore-path .prettierignore --write './src/**/*.{html,css,scss}'",
"lint": "npm run format && mate-scripts lint",
"lint": "mate-scripts lint",
"test:only": "mate-scripts test",
"build": "mate-scripts build",
"deploy": "mate-scripts deploy",
Expand All @@ -22,7 +22,7 @@
"@mate-academy/backstop-config": "latest",
"@mate-academy/bemlint": "latest",
"@mate-academy/linthtml-config": "latest",
"@mate-academy/scripts": "^1.8.6",
"@mate-academy/scripts": "^1.9.12",
"@mate-academy/stylelint-config": "latest",
"@parcel/transformer-sass": "^2.12.0",
"backstopjs": "6.3.23",
Expand Down
36 changes: 34 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,42 @@
<title>Calendar</title>
<link
rel="stylesheet"
href="styles/index.scss"
href="styles/main.scss"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The href attribute is linking to a SCSS file (styles/main.scss). HTML cannot directly use SCSS files. You need to compile the SCSS into a CSS file and link to that CSS file instead.

/>
</head>
<body>
<h1>Calendar</h1>
<div class="calendar calendar--start-day-sun calendar--month-length-31">
<div class="calendar__day calendar__day--1"></div>
<div class="calendar__day calendar__day--2"></div>
<div class="calendar__day calendar__day--3"></div>
<div class="calendar__day calendar__day--4"></div>
<div class="calendar__day calendar__day--5"></div>
<div class="calendar__day calendar__day--6"></div>
<div class="calendar__day calendar__day--7"></div>
<div class="calendar__day calendar__day--8"></div>
<div class="calendar__day calendar__day--9"></div>
<div class="calendar__day calendar__day--10"></div>
<div class="calendar__day calendar__day--11"></div>
<div class="calendar__day calendar__day--12"></div>
<div class="calendar__day calendar__day--13"></div>
<div class="calendar__day calendar__day--14"></div>
<div class="calendar__day calendar__day--15"></div>
<div class="calendar__day calendar__day--16"></div>
<div class="calendar__day calendar__day--17"></div>
<div class="calendar__day calendar__day--18"></div>
<div class="calendar__day calendar__day--19"></div>
<div class="calendar__day calendar__day--20"></div>
<div class="calendar__day calendar__day--21"></div>
<div class="calendar__day calendar__day--22"></div>
<div class="calendar__day calendar__day--23"></div>
<div class="calendar__day calendar__day--24"></div>
<div class="calendar__day calendar__day--25"></div>
<div class="calendar__day calendar__day--26"></div>
<div class="calendar__day calendar__day--27"></div>
<div class="calendar__day calendar__day--28"></div>
<div class="calendar__day calendar__day--29"></div>
<div class="calendar__day calendar__day--30"></div>
<div class="calendar__day calendar__day--31"></div>
</div>
</body>
</html>
Empty file removed src/styles/.gitkeep
Empty file.
3 changes: 0 additions & 3 deletions src/styles/index.scss

This file was deleted.

205 changes: 205 additions & 0 deletions src/styles/main.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/main.css.map

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

68 changes: 68 additions & 0 deletions src/styles/main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
$day-side: 100px;
$padding: 10px;
$days-names: 'mon' 1,
'tue' 2,
'wed' 3,
'thu' 4,
'fri' 5,
'sat' 6,
'sun' 7;

body {
margin: 0;
display: flex;
height: 100vh;
}

.calendar {
margin: auto;

display: flex;
flex-wrap: wrap;
gap: 1px;

width: calc(#{$day-side} * 7 + (1px * 6));
padding: 0 #{$padding};

.calendar__day {
background-color: #eee;
box-sizing: border-box;
height: $day-side;
width: $day-side;
border: 1px solid black;

display: flex;
justify-content: center;
align-items: center;

font-family: Arial, sans-serif;
font-size: 30px;
color: bla;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo in the color property value: 'bla'. It should be corrected to a valid color value, such as 'black' or a hex code like '#000'.

}

.calendar__day:hover {
cursor: pointer;
background-color: #ffbfcb;
transition-duration: 0.5s;
transform: translateY(-20px);

}
}

@each $name, $day in $days-names {
.calendar--start-day-#{$name} > .calendar__day--1 {
margin-left: calc((#{$day-side} + 1px) * (#{$day} - 1));
}
}

@for $i from 1 through 31 {
.calendar__day--#{$i}::before {
content: '#{$i}';
}
}

@for $i from 28 through 31 {
.calendar--month-length-#{$i} > .calendar__day:nth-child(n + #{$i + 1}) {
display: none;
}
}
Loading