| Crates.io | nenyr |
| lib.rs | nenyr |
| version | 1.0.0-beta.1 |
| created_at | 2024-09-22 16:28:17.26034+00 |
| updated_at | 2025-01-04 14:19:16.034183+00 |
| description | The initial version of the Nenyr parser delivers robust foundational capabilities for interpreting Nenyr syntax. It intelligently processes central, layout, and module contexts, handling complex variable, aliases, themes, breakpoints, imports, typefaces definitions and precise class and animation declarations. Equipped with advanced tokenization, the parser ensures efficient parsing while offering detailed, context-aware error reporting. Designed for scalability, it provides the groundwork for seamless integration with larger projects, enabling future enhancements to support more complex styles and features. This version ensures both clarity and reliability in parsing, paving the way for continued innovation within the Nenyr ecosystem. |
| homepage | |
| repository | https://github.com/patrickgunnar/nenyr |
| max_upload_size | |
| id | 1383098 |
| size | 796,720 |
Nenyr is the declarative domain-specific language (DSL) that powers the Galadriel CSS framework. This framework is designed to streamline the process of creating advanced, modular, and context-aware styles for web applications. Nenyr provides a structured, intuitive approach to styling, ensuring scalability, flexibility, and maintainability. By following Nenyr’s syntax and grammar rules, developers can create responsive, theme-based designs with minimal effort, all while adhering to best practices for modular CSS development.
Nenyr is based on several key principles that enable developers to write clear, maintainable, and efficient styles. These principles form the backbone of how styles are constructed within the Galadriel CSS framework:
Nenyr uses a declarative syntax, making it both human-readable and machine-optimized. This ensures that styles are concise, self-explanatory, and easy to maintain. Within a block of Nenyr code, method declarations are separated by commas, and optional trailing commas are allowed for flexibility.
Nenyr promotes modularity by organizing styles into distinct contexts. Each context represents a different scope of styling—Central, Layout, and Module—ensuring that styles are applied only where necessary. A key rule to follow when using Nenyr is that each .nyr file should contain only one context construction. Defining multiple contexts within the same file will trigger an error during the build process, as this is forbidden in the framework.
Galadriel CSS is built on a utility-first design philosophy, ensuring that each Nenyr property-value pair generates a unique CSS utility class. If you declare the same property-value combination multiple times across your code, Galadriel CSS will optimize this by generating only a single CSS utility class for that declaration. This approach minimizes redundancy and maximizes performance, as identical declarations are merged into a single, reusable class. By writing clean, context-aware Nenyr code, developers delegate the complex tasks of compiling and optimizing CSS to the Galadriel CSS framework during the build process. As a result, the framework efficiently handles style generation and minimizes the final CSS file size, ensuring a lean, maintainable, and scalable application.
Nenyr offers a wide range of features that make it a powerful tool for styling web applications. Below are some of the most important features:
Nenyr allows you to import external CSS files or third-party styles, seamlessly importing them into the output CSS content. This ensures that external resources can be easily incorporated into your project.
Custom fonts can be declared and used consistently across your application, ensuring a cohesive and distinctive typographic style.
Breakpoints provide the ability to create responsive designs. Once defined, they can be consistently applied throughout the application, ensuring your design adapts smoothly to different screen sizes.
Nenyr allows you to define themes that manage light and dark modes. These themes ensure consistency across your application and adapt to the user's preferences.
To simplify the code and make it more personalized, Nenyr allows the definition of aliases for common properties. This improves readability and reduces repetition.
Reusable values, such as colors or dimensions, can be declared as variables. This promotes consistency and ease of maintenance across your stylesheets.
Nenyr supports the creation of complex animations through declarative methods. You can define animations at various states (e.g., From, Halfway, To, Fraction, or Progressive), with progressive transformations to create intricate effects.
Classes are central to Nenyr. Styles are encapsulated within classes that can inherit from other classes, promoting a hierarchical approach to styling. Additionally, classes support primary styles, pseudo-methods like Hover and Active, and conditional styles based on breakpoints.
Nenyr follows a structured syntax for defining various styling elements. Here's an overview of the core grammar rules:
Declare keyword, followed by the method type (e.g., Imports, Variables, Animation)..nyr file. Defining more than one context within a file will cause an error. Ensure each .nyr file adheres to this rule for proper compilation.// to add single-line comments in your code./* */ for multi-line comments.${} (e.g., backgroundColor: "${primaryColor}", animationName: "${myAnimationName}").Declare and Variables are case-sensitive and must be used in the exact format.\".When writing Nenyr code in .nyr files, the Galadriel CSS framework processes this code and transforms it into optimized CSS during the build process. Here's how the compilation process works:
The integration client handles the communication between the Galadriel CSS and the application’s front-end. It replaces the Nenyr markups with the appropriate CSS utility classes and ensures that the required CSS rules are applied globally.
To make the most of Nenyr and maintain clean, scalable code, consider the following best practices:
//, while block comments use /* */..nyr file contains only one context definition. Attempting to define more than one context in a single file will result in an error during the build process.Nenyr is the heart of Galadriel CSS (or let me say, Nenyr is the ring of power of Galadriel CSS), providing a powerful, declarative syntax that enables developers to create complex, modular styles. By adhering to the grammar rules and syntax of Nenyr, you unlock the full potential of scalable and context-aware styling. Its flexible, modular approach ensures that your styles remain maintainable as your application grows, making it an ideal choice for large, dynamic projects.
To maximize the power of Nenyr, be sure to follow the best practices outlined in this guide. Whether you're working with animations, themes, or breakpoints, Nenyr gives you the tools you need to craft efficient and adaptive styles.
Explore further documentation to dive deeper into specific Nenyr contexts and methods available for you to leverage in your projects!