-
-
Notifications
You must be signed in to change notification settings - Fork 689
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
Fix precedence of the quanta layer by adding a base layer for all the… #6539
base: main
Are you sure you want to change the base?
Conversation
… basic components. Added a setting in config object for setting the site's CSS layers.
✅ Deploy Preview for plone-components canceled.
|
|
||
The purpose of this package is to provide an agnostic set of baseline components to build Plone sites upon. | ||
|
||
## Usage | ||
|
||
Using the package manager of your choice (npm, yarn, pnpm) install the package: | ||
Using the package manager of your choice (npm, yarn, pnpm) to install the package in your app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the package manager of your choice (npm, yarn, pnpm) to install the package in your app. | |
You can use your choice of package manager (npm, yarn, or pnpm) to install the package in your app. |
|
||
The purpose of this package is to provide an agnostic set of baseline components to build Plone sites upon. | ||
|
||
## Usage | ||
|
||
Using the package manager of your choice (npm, yarn, pnpm) install the package: | ||
Using the package manager of your choice (npm, yarn, pnpm) to install the package in your app. | ||
Use pnpm in case you are adding them a Volto add-on/workspace: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use pnpm in case you are adding them a Volto add-on/workspace: | |
If you add the components to a Volto add-on or workspace, use pnpm, as shown. |
@@ -53,12 +54,19 @@ or selectively: | |||
import '@plone/components/src/styles/basic/TextField.css'; | |||
``` | |||
|
|||
### CSS layers | |||
|
|||
This package use CSS layers to provide a way to style the components in a more flexible way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This package use CSS layers to provide a way to style the components in a more flexible way. | |
This package uses CSS layers to style the components in a more flexible way. |
|
||
## Quanta | ||
|
||
This package also features the Quanta components. | ||
The Quanta theme is an example of it. | ||
These components use the basic styling as a baseline, not only in styling, but also in the component side, reusing the CSS and custom CSS properties in it. | ||
These components use the basic styling as a baseline, extending them to achieve Quanta look and feel. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These components use the basic styling as a baseline, extending them to achieve Quanta look and feel. | |
These components use the basic styling as a baseline, extending them to achieve the Quanta look and feel. |
@@ -0,0 +1 @@ | |||
Added the type for a setting in config object for setting the site's CSS layers. @sneridagh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the type for a setting in config object for setting the site's CSS layers. @sneridagh | |
Added the typing for the new `cssLayers` configuration object setting. @sneridagh |
@@ -0,0 +1 @@ | |||
Fixed precedence of the quanta layer by adding a base layer for all the basic components. @sneridagh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed precedence of the quanta layer by adding a base layer for all the basic components. @sneridagh | |
Fixed precedence of the Quanta layer by adding a base layer for all the basic components. @sneridagh |
@@ -463,6 +463,13 @@ querystringSearchGet | |||
[See an explanation of character limits in URLs](https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers/417184#417184). | |||
Please test this setting properly before enabling in a production site. | |||
|
|||
cssLayers | |||
If you want to use CSS layers in Volto styling, it's possible to define them making sure that they are defined and applied at the very top level of the page (head tag). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to use CSS layers in Volto styling, it's possible to define them making sure that they are defined and applied at the very top level of the page (head tag). | |
To use CSS layers when styling Volto, you can define and apply them at the very top level of the page, where they appear in the `<head>` tag. |
@@ -62,11 +62,19 @@ Using them as a baseline will allow you to quickly build your theme around them. | |||
`@plone/components` basic styles provide a simple, yet powerful, set of tokenized custom CSS properties that will help you customize your own styles on the top of the basic styling. | |||
You can override them in your classes while maintaining them for others. | |||
|
|||
### CSS layers | |||
|
|||
This package use CSS layers to provide a way to style the components in a more flexible way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This package use CSS layers to provide a way to style the components in a more flexible way. | |
This package uses CSS layers to style the components in a more flexible way. |
This package use CSS layers to provide a way to style the components in a more flexible way. | ||
It uses the `plone-components` layer name to scope all the CSS declarations in the package. | ||
The basic styling uses the nested `plone-components.base` named layer. | ||
You can use the `plone-components` layer to override the basic styling, or use the `plone-components.base` layer to override the basic styling in a more specific way. | ||
|
||
## Quanta |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs to increase a level because it is under Styling, not a sibling to it.
## Quanta | |
### Quanta |
### Quanta | ||
|
||
This package also features the Quanta components. | ||
The Quanta theme is an example of it. | ||
These components use the basic styling as a baseline, not only in styling, but also in the component side, reusing the CSS and custom CSS properties in it. | ||
These components use the basic styling as a baseline, extending them to achieve Quanta look and feel. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These components use the basic styling as a baseline, extending them to achieve Quanta look and feel. | |
These components use the basic styling as a baseline, extending them to achieve the Quanta look and feel. |
@pnicolli I found a bug in the definition of the layers, the quanta
plone-components.quanta
layer needs to have more priority than the base one. I misunderstood how nested layers worked.I added a nested
plone-components.base
layer to all basic components. So, if we want to override declarations in the nested (default) layers, we only have to scope them to the main layer.Also, I added the ability to setup the layers at the top (
Html.jsx
component), so we have a "main" centralized entry point to define them in Volto.