-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow build process to split css files for front end and backend. (#1418
) Related to #963. This PR splits up some of our CSS build process to have seperate files generated for blocks and editor specific styles of blocks. Block specific styles are now loaded both on the front-end and back end. Styles that should appear on both are currently in a block.scss file. Styles added: wp-edit-blocks: blocks/build/edit-block.css wp-blocks: blocks/build/style.css Adding documentation about the build process, updating variable names, reducing duplication. Making the drop cap style work on the front end as well as gallery styles.
- Loading branch information
1 parent
de00f70
commit 8dfc4c5
Showing
8 changed files
with
162 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
.wp-block-gallery { | ||
display: flex; | ||
flex-wrap: wrap; | ||
|
||
&:not( .components-placeholder ) { | ||
margin-right: -16px; | ||
margin-bottom: -16px; | ||
} | ||
|
||
.blocks-gallery-image { | ||
flex-grow: 1; | ||
margin: 0 16px 16px 0; | ||
|
||
img { | ||
max-width: 100%; | ||
} | ||
} | ||
|
||
// Cropped | ||
&.is-cropped .blocks-gallery-image { | ||
img { | ||
width: 100%; | ||
height: 100%; | ||
object-fit: cover; | ||
} | ||
|
||
// Alas, IE11+ doesn't support object-fit | ||
_:-ms-lang(x), img { | ||
height: auto; | ||
width: auto; | ||
} | ||
} | ||
|
||
&.columns-1 figure { | ||
width: calc(100% / 1 - 2 * 8px); | ||
} | ||
&.columns-2 figure { | ||
width: calc(100% / 2 - 3 * 8px); | ||
} | ||
&.columns-3 figure { | ||
width: calc(100% / 3 - 4 * 8px); | ||
} | ||
&.columns-4 figure { | ||
width: calc(100% / 4 - 5 * 8px); | ||
} | ||
&.columns-5 figure { | ||
width: calc(100% / 5 - 6 * 8px); | ||
} | ||
&.columns-6 figure { | ||
width: calc(100% / 6 - 7 * 8px); | ||
} | ||
&.columns-7 figure { | ||
width: calc(100% / 7 - 8 * 8px); | ||
} | ||
&.columns-8 figure { | ||
width: calc(100% / 8 - 9 * 8px); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
p.has-drop-cap { | ||
&:first-letter { | ||
float: left; | ||
font-size: 4.1em; | ||
line-height: 0.7; | ||
font-family: serif; | ||
font-weight: bold; | ||
margin: .07em .23em 0 0; | ||
text-transform: uppercase; | ||
font-style: normal; | ||
} | ||
} | ||
|
||
p.has-drop-cap:not( :focus ) { | ||
overflow: hidden; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters