CSS Properties
Learn how to use CSS properties in BuckShotPlusPlus
BuckShotPlusPlus provides comprehensive support for CSS properties, allowing you to style your views and pages with standard CSS properties. The system handles the conversion between BuckShotPlusPlus property names and their DOM equivalents automatically.
How it works
CSS properties in BuckShotPlusPlus can be applied directly to views using standard property assignment syntax. The system supports all common CSS properties while maintaining a clean and consistent coding style.
Declaring CSS Properties
To apply CSS properties to a view, simply declare them as properties within your view definition. Properties use the standard CSS naming convention, with kebab-case names (using hyphens).
Here's a basic example:
Supported Properties
BuckShotPlusPlus supports a wide range of CSS properties, including but not limited to:
Layout Properties
align-content
align-items
align-self
display
flex
flex-basis
flex-direction
flex-flow
flex-grow
flex-shrink
flex-wrap
grid properties
justify-content
position
Spacing and Sizing
margin (and all variants like margin-top, margin-bottom, etc.)
padding (and all variants)
width
height
max-width
max-height
min-width
min-height
Visual Styling
background (and all variants)
border (and all variants)
border-radius
box-shadow
color
opacity
Typography
font-family
font-size
font-weight
letter-spacing
line-height
text-align
text-decoration
text-transform
Animation and Transform
animation properties
transform
transition properties
Property Conversion
BuckShotPlusPlus automatically handles the conversion between property names in your code and their DOM equivalents. For example:
This will be correctly converted to the appropriate CSS property when rendered in the browser.
Use cases
Component Styling: Apply consistent styling to your components using standard CSS properties.
Responsive Design: Create responsive layouts using flexbox and grid properties.
Animation and Transitions: Add dynamic behavior to your components.
Important notes
CSS property names in BuckShotPlusPlus use kebab-case format (with hyphens), matching standard CSS conventions.
Values for CSS properties should be provided as strings, including numeric values with units.
The system supports shorthand properties (like
margin: "10px 20px"
) as well as individual properties (likemargin-top: "10px"
).When using properties that require vendor prefixes in CSS, BuckShotPlusPlus handles the prefixing automatically.
Some properties that might affect the content management system's functionality (like 'content') may be restricted for security reasons.
Best Practices
Use consistent units throughout your application (stick to either px, rem, or em).
Organize properties in logical groups within your views for better maintainability.
Consider creating reusable views with common styling patterns to maintain consistency.
Test your styles across different browsers to ensure compatibility.
Use meaningful names for views that reflect their styling purpose when appropriate.
Last updated
Was this helpful?