Skip to content

Commit 07f9b58

Browse files
committed
document grid areas
1 parent bd4a4f4 commit 07f9b58

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

docs/handling-uploads-with-media-library-pro/customizing-css.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ In this video, you'll see the various option on how to customize the look and fe
1313

1414
Want to see more videos like this? Check out our [free video course on how to use Laravel Media Library](https://spatie.be/videos/discovering-laravel-media-library).
1515

16-
## Option 1: Use your own Tailwind CSS configuration
16+
### Option 1: Use your own Tailwind CSS configuration
1717

1818
Instead of importing/linking the pre-built `dist/styles.css` from the package, you can import the `src/styles.css` and run every `@apply` rule through your own `tailwind.config.js`.
1919

@@ -33,7 +33,7 @@ Instead of importing/linking the pre-built `dist/styles.css` from the package, y
3333

3434
This is exactly what happens in the header of the homepage at [medialibrary.pro](https://medialibrary.pro): the shown component has a slightly blue-ish look, using the color palette of this site.
3535

36-
## Option 2: Override only portions in your CSS
36+
### Option 2: Override only portions in your CSS
3737

3838
If you only want to tinker with certain aspects of the component but like to keep the CSS in sync with future package updates, nothing stops you from overriding only certain CSS rules with your own tweaks. Every DOM-element of the component has a class with prefix `media-library`.
3939

@@ -53,7 +53,7 @@ Inspect the component in your browser to find out that the thumbnail is rendered
5353

5454
```
5555

56-
## Option 3: Copy the CSS to your own project
56+
### Option 3: Copy the CSS to your own project
5757

5858
If you want to go full-option, you can always copy `src/styles.css` to your own project and go wild.
5959
In this example we renamed the file to `custom/media-library.css`.
@@ -91,3 +91,24 @@ If you're using PurgeCSS, you might have to add a rule to your whitelist pattern
9191
```js
9292
mix.purgeCss({ whitelistPatterns: [/^media-library/] });
9393
```
94+
95+
## Changing the order of the sections
96+
97+
The components have three major sections that are rendered in this order: the validation errors, the items and the uploader.
98+
99+
![Screenshot of component](/docs/laravel-medialibrary/v9/images/pro/sections.png)
100+
101+
You can change the order of these sections to be more consistent with your app, without having to create a custom component from scratch.
102+
103+
Add the following lines to your CSS, and switch the order of the sections around to your liking.
104+
105+
```css
106+
.media-library-multiple {
107+
grid-template-areas:
108+
"uploader"
109+
"items"
110+
"errors";
111+
}
112+
```
113+
114+
![Screenshot of component with sections in different order](/docs/laravel-medialibrary/v9/images/pro/sections-order-switched.png)
87.5 KB
Loading

docs/images/pro/sections.png

87.4 KB
Loading

0 commit comments

Comments
 (0)