mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-03 06:40:05 +00:00
LibWeb: Fix grid placement with named lines
This commit is contained in:
parent
6fc9de7aab
commit
852e8ff12f
Notes:
github-actions[bot]
2025-04-05 19:31:34 +00:00
Author: https://github.com/Schottkyc137
Commit: 852e8ff12f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3907
Reviewed-by: https://github.com/kalenikaliaksandr ✅
8 changed files with 277 additions and 12 deletions
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html><style>
|
||||
.wrapper {
|
||||
display: grid;
|
||||
grid-gap: 10px;
|
||||
grid-template-columns: [col] 100px [col] 100px [col] 100px [col] 100px;
|
||||
grid-template-rows: [row] auto [row] auto [row];
|
||||
background-color: #fff;
|
||||
color: #444;
|
||||
}
|
||||
.box {
|
||||
background-color: #444;
|
||||
color: #fff;
|
||||
border-radius: 5px;
|
||||
padding: 20px;
|
||||
font-size: 150%;
|
||||
}
|
||||
.a {
|
||||
grid-row: row -2 ;
|
||||
}
|
||||
.b {
|
||||
grid-row: row -1 ;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<div class="box a">A</div>
|
||||
<div class="box b">B</div>
|
|
@ -0,0 +1,44 @@
|
|||
<!DOCTYPE html><style>
|
||||
.wrapper {
|
||||
display: grid;
|
||||
grid-gap: 10px;
|
||||
grid-template-columns: [col] 100px [col] 100px [col] 100px [col] 100px;
|
||||
grid-template-rows: [row] auto [row] auto [row];
|
||||
background-color: #fff;
|
||||
color: #444;
|
||||
}
|
||||
.box {
|
||||
background-color: #444;
|
||||
color: #fff;
|
||||
border-radius: 5px;
|
||||
padding: 20px;
|
||||
font-size: 150%;
|
||||
}
|
||||
.a {
|
||||
grid-column: col / span 2;
|
||||
grid-row: row ;
|
||||
}
|
||||
.b {
|
||||
grid-column: col 3 / span 2 ;
|
||||
grid-row: row ;
|
||||
}
|
||||
.c {
|
||||
grid-column: col ;
|
||||
grid-row: row 2 ;
|
||||
}
|
||||
.d {
|
||||
grid-column: col 2 / span 3 ;
|
||||
grid-row: row 2 ;
|
||||
}
|
||||
.e {
|
||||
grid-column: col / span 4;
|
||||
grid-row: row 3;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<div class="box a">A</div>
|
||||
<div class="box b">B</div>
|
||||
<div class="box c">C</div>
|
||||
<div class="box d">D</div>
|
||||
<div class="box e">E</div>
|
44
Tests/LibWeb/Layout/input/grid/line-based-with-repeat.html
Normal file
44
Tests/LibWeb/Layout/input/grid/line-based-with-repeat.html
Normal file
|
@ -0,0 +1,44 @@
|
|||
<!DOCTYPE html><style>
|
||||
.wrapper {
|
||||
display: grid;
|
||||
grid-gap: 10px;
|
||||
grid-template-columns: repeat(4, [col] 100px) ;
|
||||
grid-template-rows: repeat(3, [row] auto);
|
||||
background-color: #fff;
|
||||
color: #444;
|
||||
}
|
||||
.box {
|
||||
background-color: #444;
|
||||
color: #fff;
|
||||
border-radius: 5px;
|
||||
padding: 20px;
|
||||
font-size: 150%;
|
||||
}
|
||||
.a {
|
||||
grid-column: col / span 2;
|
||||
grid-row: row ;
|
||||
}
|
||||
.b {
|
||||
grid-column: col 3 / span 2 ;
|
||||
grid-row: row ;
|
||||
}
|
||||
.c {
|
||||
grid-column: col ;
|
||||
grid-row: row 2 ;
|
||||
}
|
||||
.d {
|
||||
grid-column: col 2 / span 3 ;
|
||||
grid-row: row 2 ;
|
||||
}
|
||||
.e {
|
||||
grid-column: col / span 4;
|
||||
grid-row: row 3;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<div class="box a">A</div>
|
||||
<div class="box b">B</div>
|
||||
<div class="box c">C</div>
|
||||
<div class="box d">D</div>
|
||||
<div class="box e">E</div>
|
Loading…
Add table
Add a link
Reference in a new issue