-
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.
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 Caveats: It was suggested that the reverse be done, by using an edit.scss to hold editor specific styles. This seemed pretty daunting a task to me and I did not fully grasp what benefit that would bring over this approach either. ** Testing Instructions ** build the files via `npm run build` or `npm run dev` Verify that the gallery columns work both on the front end as well as back end. Verify that the drop cap style still works on the back end.
- Loading branch information
1 parent
ba3f4cb
commit 19e54d5
Showing
8 changed files
with
137 additions
and
61 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,16 @@ | ||
.drop-cap-true .blocks-editable__tinymce:not( :focus ) { | ||
&: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; | ||
} | ||
} | ||
|
||
.drop-cap-true: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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
.blocks-gallery { | ||
display: flex; | ||
flex-wrap: wrap; | ||
|
||
.blocks-gallery-image { | ||
flex-grow: 1; | ||
margin: 8px; | ||
|
||
img { | ||
max-width: 100%; | ||
} | ||
} | ||
|
||
&.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
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