Skip to content
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

A more user friendly implementation #98

Open
machour opened this issue Jan 16, 2019 · 2 comments
Open

A more user friendly implementation #98

machour opened this issue Jan 16, 2019 · 2 comments

Comments

@machour
Copy link
Member

machour commented Jan 16, 2019

Something that was already bugging me with yii2-bootstrap, and is now even "worse", is the developer experience when using the Yii2 bootstrap packages.

Take for instance the Progress component.

Even with bootstrap3, creating a successful animating stripped progress at 70% is painful:

// striped animated
echo Progress::widget([
   'percent' => 70,
   'barOptions' => ['class' => 'progress-bar-success'],
   'options' => ['class' => 'active progress-striped']
]);

Here, I need to remember the class names and what class should go on what part of the Progress element, etc.

You end up most of the time consulting the bootstrap documentation to remember the syntax, and there, you just have the plain HTML snippet sitting in front of you, that you could copy/paste and be done with.

I think that we need to care more about DX here, and that creating a progress element should be as straight forward as:

Progress::widget(['percent' => 20, 'color' => Bootstrap::SUCCESS, 'striped' => true, 'animated' => true]);

options would be kept for a more advanced usage, when the developer really wants to stray out of bootstrap path.

@machour machour added this to the 1.0.0 milestone Jan 16, 2019
@samdark
Copy link
Member

samdark commented Jan 16, 2019

Sounds good to me.

@samdark samdark added the type:enhancement Enhancement label Jan 16, 2019
@samdark samdark modified the milestones: 1.0.0, 1.1.0 Jan 28, 2019
@machour
Copy link
Member Author

machour commented Mar 19, 2019

See if we can make #120 easier too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants