Comments (11)
Sure. It is still very fresh, to-cleanup-and-refactor stuff, but I'll keep it here for tracking. Good point!
from feliz.bulma.
Since now #2 is done, there are about one thousand lines of literals. I need to think how to extract them to proper [<Literal>]
by script, or I would blow my head of doing it manually. 😄
from feliz.bulma.
Replace let
by let [<Literal>]
maybe?
from feliz.bulma.
Uff, done. I had to write custom script, but it wasn't that hard.
from feliz.bulma.
The generated classes are made literal but the consuming helpers are not. i.e.
module helpers =
let isClearfix = PropertyBuilders.mkClass "is-clearfix"
let isPulledLeft = PropertyBuilders.mkClass "is-pulled-left"
let isPulledRight = PropertyBuilders.mkClass "is-pulled-right"
should be
module helpers =
let [<Literal>] isClearfix = PropertyBuilders.mkClass "is-clearfix"
let [<Literal>] isPulledLeft = PropertyBuilders.mkClass "is-pulled-left"
let [<Literal>] isPulledRight = PropertyBuilders.mkClass "is-pulled-right"
Otherwise Fable will generate unnecessary module exports. This way, they all still compile down to just strings
from feliz.bulma.
Oh... This one... 🤦♂ I'll fix it, thanks!
from feliz.bulma.
Oh, wait a moment. But they are IReactProperty
, not string
type.
from feliz.bulma.
Ohh my bad. Then they should be a static class that has inline static members such that Fable ignores them altogether when compiled unless they are actually used 😀
Before
[<RequireQualifiedAccess>]
module tag =
let isNormal = PropertyBuilders.mkClass ClassLiterals.``is-normal``
let isMedium = PropertyBuilders.mkClass ClassLiterals.``is-medium``
After
[<Fable.Core.Erase>]
type tag =
static member inline isNormal = PropertyBuilders.mkClass ClassLiterals.``is-normal``
static member inline isMedium = PropertyBuilders.mkClass ClassLiterals.``is-medium``
from feliz.bulma.
Please can you review now (and close if ok for Fable) 🙏
from feliz.bulma.
Nested static classes not supported
They are not supported, but you still could...
[<RequireQualifiedAccess>]
module icon =
[<Fable.Core.Erase>]
type fa =
static member inline solid n = PropertyBuilders.mkClass (sprintf "fas fa-%s" n)
static member inline regular n = PropertyBuilders.mkClass (sprintf "far fa-%s" n)
static member inline light n = PropertyBuilders.mkClass (sprintf "fal fa-%s" n)
static member inline duotone n = PropertyBuilders.mkClass (sprintf "fad fa-%s" n)
static member inline brands n = PropertyBuilders.mkClass (sprintf "fab fa-%s" n)
Though for font awesome I would recommend using the zanaptak/TypedCssClasses typed provider to pull the icon names in design-time (or use the the type provider in your build script using this to generate static font awesome icons)
The rest look good to me 👍
from feliz.bulma.
Yeah... you are right. I can create helper for font awesome on project level and keep this one clean.
from feliz.bulma.
Related Issues (20)
- No constructors are available for the type Bulma.tabs HOT 8
- Missing abstractions for level heading and title? HOT 1
- Undefined Reference in DateTimePicker HOT 8
- DateTimePicker, TimePicker display is wrong
- Is the documentation correct regaring the version of Bulma (0.8.0) that is supported? HOT 2
- How do I add bulma-calendar to my style sheet HOT 4
- Bulma.image generates without its child "img" tag. HOT 2
- Bulma Intellisense error: `Fable.React` does not contain `ReactElement` HOT 8
- After recent package updates, DateTimePicker stopped working. (Problem seems to be upstream.)
- It looks like `Bulma.title.X` modifiers are not consistent with other modifiers
- Duplicate className property warnings/errors
- Error in documentation? HOT 2
- Panel: Elements get ignored implicitly HOT 1
- Simplify/minisize number of open namespace instructions HOT 4
- Supporting span as select HOT 3
- How do I set tags in Feliz.Bulma.TagsInput? HOT 2
- Feliz.Bulma.Calendar get value HOT 3
- [Timeline] Missing modifiers for no-headers support
- Can we relax FSharp.Core requirements on this library? HOT 1
- Burger not showing on mobile devices HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from feliz.bulma.